2016-09-05 17 views
0

マシュマロデバイス上で正常に動作していないandroid.support.v7.widget.Toolbarこれは私が欲しいものである

enter image description here

この問題22または21日に、最初の画像に示されているような結果が得られます。

apply plugin: 'com.android.application' 


android { 
compileSdkVersion 22 
buildToolsVersion '22.0.1' 

defaultConfig { 
    applicationId "com.example.bob" 
    minSdkVersion 15 
    targetSdkVersion 22 
    versionCode 3 
    versionName "1.0.1" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
    } 
} 
} 
repositories { 
mavenCentral() 
} 
dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
compile 'com.android.support:appcompat-v7:22.2.0' 
compile 'com.facebook.android:facebook-android-sdk:4.0.0' 
compile files('libs/android-query-full.0.26.7.jar') 
compile files('libs/android-async-http-1.4.4.jar') 
compile 'com.google.android.gms:play-services-gcm:7.8.0' 
compile 'com.google.android.gms:play-services-ads:7.8.0' 
compile 'com.android.support:support-v4:22.2.0' 
compile 'com.github.bumptech.glide:glide:3.7.0' 
compile 'com.squareup.picasso:picasso:2.5.2' 
compile 'com.android.support:design:22.2.0' 
compile'com.github.wrdlbrnft:sorted-list-adapter:0.1.0.5' 
compile ('jp.wasabeef:recyclerview-animators:2.2.3'){ 
    exclude module: 'appcompat-v7' 
} 
} 

そして、私のAndroidのレイアウトXMLは次のとおりです:

私のbuild.gradleがあるJavaファイル内

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout  
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:fitsSystemWindows="true" 
tools:context=".SongList"> 

<android.support.design.widget.AppBarLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:theme="@style/AppTheme.AppBarOverlay"> 

    <android.support.v7.widget.Toolbar 
     android:id="@+id/toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="?attr/actionBarSize" 
     android:background="?attr/colorPrimary" 
     app:popupTheme="@style/AppTheme.PopupOverlay"/> 
    <!-- 
     app:layout_scrollFlags="scroll|enterAlways"/> 
     --> 

</android.support.design.widget.AppBarLayout> 

<include layout="@layout/song_list" /> 

</android.support.design.widget.CoordinatorLayout> 

そしてToolbarセット:

setContentView(R.layout.activity_songlist); 

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 
    setSupportActionBar(toolbar); 

私はしたくありませんコンパイルとtargetsdkのバージョンをアップグレードするbczその後、私はすべての単一の実行時のアクセス許可のメソッドを追加する必要がありますマニフェストで指定されたアクセス許可。

+0

あなたは 'song_list'レイアウトでレイアウト動作を追加しましたか? –

+0

はい...このアプリのように追加しました:layout_behavior = "@文字列/ appbar_scrolling_view_behavior" @ Uttam Panchasara –

+1

このコードは、ロリポップバージョン以下でうまく動作します。この問題はマシュマロ装置でのみ現れます。 –

答えて

0

AppBarLayoutに次の行を追加してください:

android:fitsSystemWindows="true" 

そしてCoordinatorLayoutから削除します。

関連する問題