2016-05-23 11 views
0

Ich verwende folgende Abhängigkeiten in meiner App.Aber die Symbolleiste Pfeil nach oben Symbol am unteren Rand der Symbolleiste angezeigt.Ist es ein Problem in meinem Code?die Symbolleiste Pfeilsymbol am unteren Rand der Symbolleiste

compileSdkVersion 23 
    buildToolsVersion '22.0.1' 

    defaultConfig { 
     applicationId "com.company.appname" 
     minSdkVersion 19 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.0.0" 
} 

dependencies { 
    compile('com.android.support:cardview-v7:23.2.0') { 
     force = true 
    } 
    compile 'com.android.support:design:23.3.0' 
    compile 'com.android.support:gridlayout-v7:23.3.0' 
    compile 'com.android.support:recyclerview-v7:23.3.0' 
    compile 'com.android.support:support-v4:23.3.0' 
    compile 'com.google.android.gms:play-services-ads:8.4.0' 
} 

GalleryActivity.java

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

     getSupportActionBar().setDisplayUseLogoEnabled(false); 
     getSupportActionBar().setDisplayShowTitleEnabled(false); 
     getSupportActionBar().setDisplayShowHomeEnabled(true); 
     getSupportActionBar().setDisplayHomeAsUpEnabled(true); 

     TextView toolBarTitleTextView = (TextView) findViewById(R.id.gallery_activity_toolbar_title); 
     toolBarTitleTextView.setText(R.string.title_gallery_fragment); 

activity_gallery.xml

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    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="com.company.appname.activities.GalleryActivity"> 

    <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" 
      style="@style/AppTheme.ToolbarOverlay" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="?attr/colorPrimary" 
      android:fitsSystemWindows="true" 
      app:popupTheme="@style/AppTheme.PopupOverlay"> 

      <TextView 
       android:id="@+id/gallery_activity_toolbar_title" 
       style="@style/App.Widget.TextView.Toolbar.Title" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 

     </android.support.v7.widget.Toolbar> 

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

    <fragment 
     android:id="@+id/gallery_fragment" 
     android:name="com.company.appname.fragments.GalleryFragment" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior" 
     tools:showIn="@layout/activity_gallery" /> 

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

enter image description here

Antwort

1

Versuchen Hinzufügen android:fitsSystemWindows="true"-012.

1

Hauptgrund ist android:fitsSystemWindows="true" Es ist seltsam, warum es nicht funktioniert.

Sie können diese alternative Lösung versuchen. Geben Sie diese Eigenschaft in Ihrem Stil.

<item name="android:fitsSystemWindows">true</item> 
0

Android entfernt: fitsSystemWindows = "true" von CoordinatorLayout. Es funktioniert super!

Verwandte Themen