Android 线性布局在顶部显示意外的边距
我使用底部导航栏和LinearLayout作为第一个布局选项卡,但顶部的意外边距显示我已将尺寸更改为0dp,但没有任何更改 这是我的主要片段Android 线性布局在顶部显示意外的边距,android,android-layout,android-fragments,android-linearlayout,Android,Android Layout,Android Fragments,Android Linearlayout,我使用底部导航栏和LinearLayout作为第一个布局选项卡,但顶部的意外边距显示我已将尺寸更改为0dp,但没有任何更改 这是我的主要片段 实际上,有两种布局具有相同的边距问题,这是其中之一 这是你的问题。 删除此项,一切都会好起来。发布相同屏幕截图的屏幕截图。请注意,谢谢! <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.an
实际上,有两种布局具有相同的边距问题,这是其中之一
这是你的问题。
删除此项,一切都会好起来。发布相同屏幕截图的屏幕截图。请注意,谢谢!
<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>
<View
android:id="@+id/controlView"
android:layout_width="match_parent"
android:layout_height="16dp" />