2017-10-09 16 views
0

私は、フラグメントにコンテナを使用してMainActivityを使用します。 MainActivitieのXMLは、次のコードでのツールバーが含まれています:絵で見ることができるように、私はアクションバーの下に、この不要な余分なスペースを持っているすべての私の断片で :Android - 不要なスペースActionBar

<android.support.v7.widget.Toolbar 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="@color/c_green" 
    android:id="@+id/toolbar" 
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
    app:title="@string/app_name" 
    android:contentInsetLeft="10dp" 
    android:contentInsetStart="10dp" 
    app:contentInsetLeft="10dp" 
    android:layout_margin="0dp" 
    android:padding="0dp"> 
    <ImageView 
     android:id="@+id/logo" 
     android:layout_width="100dp" 
     android:layout_height="35dp" 
     android:layout_gravity="left" /> 
</android.support.v7.widget.Toolbar> 

問題は次のようです。 recyclerViewにあなたは空白の下CardViewsスライドを見ることができます

Here you can clearly see the white space that is present everywhere in the app.

。私はActionBarに何か問題があると思う。 パディング0dpとマージン0dpを追加しようとしましたが、その変更はありません。

ありがとうございます!

答えて

-1

私の代わりに

<dimen name="myActionBar_height">48dp</dimen> 

android:layout_marginTop="@dimen/myActionBar_height" 

を使用して、私の断片で

android:layout_marginTop="?attr/actionBarSize" 

を使用しての余分なスペースを固定することを見出しました。 しかし、これは良い解決策ではありません。

問題は余白の余分な10dpのようです。

関連する問題