如何用片段布局填充内容布局

时间:2022-03-16 20:49:59

i need some help.

我需要一些帮助。

I have a CoordinatorLayout in my content layout and RelativeLayout in my fragment, but i want fill whole space with the fragment layout. Someone help me?

在我的内容布局中有一个协调布局,在我的片段中有相对布局,但是我想要用片段布局填充整个空间。有人帮助我吗?

如何用片段布局填充内容布局

2 个解决方案

#1


1  

I suppose you have some margins in your activity layout

我想你在你的活动布局中有一些空白处

#2


0  

I guess on your xml you have something like this :

我猜在你的xml上有这样的东西:

 android:paddingBottom="@dimen/activity_vertical_margin"
 android:paddingLeft="@dimen/activity_horizontal_margin" 
 android:paddingRight="@dimen/activity_horizontal_margin"
 android:paddingTop="@dimen/activity_vertical_margin" >

Just remove those paddings and your FragmentLayout will be filled.

只需删除这些衬垫,您的碎片布局将被填充。

#1


1  

I suppose you have some margins in your activity layout

我想你在你的活动布局中有一些空白处

#2


0  

I guess on your xml you have something like this :

我猜在你的xml上有这样的东西:

 android:paddingBottom="@dimen/activity_vertical_margin"
 android:paddingLeft="@dimen/activity_horizontal_margin" 
 android:paddingRight="@dimen/activity_horizontal_margin"
 android:paddingTop="@dimen/activity_vertical_margin" >

Just remove those paddings and your FragmentLayout will be filled.

只需删除这些衬垫,您的碎片布局将被填充。