2

我正在使用BottomNavigationBar和LinearLayout作为第一个布局选项卡,但此顶部的意外保证金显示我已将我的维度更改为0dp,但没有任何更改。LinearLayout在顶部的意外保证金

这是我的主要片段

<LinearLayout 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:id="@+id/container" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical"> 

    <View 
    android:id="@+id/controlView" 
    android:layout_width="match_parent" 
    android:layout_height="16dp" /> 

    <FrameLayout 
    android:id="@+id/content_frag" 
    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:layout_weight="1" > 

</FrameLayout> 

    <android.support.design.widget.BottomNavigationView 
    android:id="@+id/navigation" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_gravity="bottom" 
    android:background="@color/colorPrimaryDark" 
    app:menu="@menu/navigation" /> 

</LinearLayout> 

实际上存在具有相同幅度的问题两个布局,这是其中的一个

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" 
android:background="@color/grey_300">  

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="200dp" 
    android:background="@drawable/gcover" 
    android:id="@+id/relativeLayout"> 

    <de.hdodenhof.circleimageview.CircleImageView 
     xmlns:app="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/profPhoto" 
     android:clickable="true" 
     android:layout_width="120dp" 
     android:layout_height="120dp" 
     android:padding="20dp" 
     android:src="@drawable/default_prof" 
     android:scaleType="centerCrop" 
     app:civ_border_color="@color/trans" 
     app:civ_border_width="2dp" 
     android:layout_centerVertical="true" 
     android:layout_centerHorizontal="true" /> 

</RelativeLayout> 

<LinearLayout 
    android:id="@+id/linearLayout2" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginTop="20dp" 
    android:orientation="vertical"> 

    <android.support.v7.widget.AppCompatButton 
     android:id="@+id/prof_invite" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="150dp" 
     android:layout_marginTop="2dp" 
     android:background="@color/green_300" 
     android:drawableLeft="@drawable/icon1" 
     android:padding="12dp" 
     android:text="invite friends" /> 


    <android.support.v7.widget.AppCompatButton 
     android:id="@+id/prof_conf" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="150dp" 
     android:layout_marginTop="2dp" 
     android:background="@color/ball_D" 
     android:drawableLeft="@drawable/icon2" 
     android:padding="12dp" 
     android:text="settings" /> 

    <android.support.v7.widget.AppCompatButton 
     android:id="@+id/prof_out" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="150dp" 
     android:layout_marginTop="2dp" 
     android:background="@color/colorPrimaryDark" 
     android:drawableLeft="@drawable/icon" 
     android:padding="12dp" 
     android:text="log out" /> 

</LinearLayout> 

+0

张贴截图相同 –

+0

截图添加 – GGWP

回答

2
<View 
    android:id="@+id/controlView" 
    android:layout_width="match_parent" 
    android:layout_height="16dp" /> 

这是你的问题。 删除它,它会没事的。

+0

永远不会注意到,谢谢! – GGWP