我们用fragment替换一个view时,代码如下:Fragment1 fragment1 = new Fragment1();
transaction.replace(R.id.up_layout, fragment1);其中up_layout设置了宽高:
<RelativeLayout
android:id="@+id/up_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="3">
</RelativeLayout>替换后,fragment不遵从布局的宽高属性,界面混乱,如何解决?
transaction.replace(R.id.up_layout, fragment1);其中up_layout设置了宽高:
<RelativeLayout
android:id="@+id/up_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="3">
</RelativeLayout>替换后,fragment不遵从布局的宽高属性,界面混乱,如何解决?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货