1
Layout 1 Layout2
BBBBBBBBAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
我2个片段的初始布局是一样的画面(布局1)Android蜂窝:布局问题 - 隐藏/显示FrameLayouts
有其得到填补在运行时 有一个片段内的LinearLayout 2个framelayouts。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout android:id="@+id/frame_fragment"
android:layout_weight="1" android:layout_width="0px"
android:layout_height="fill_parent" />
<FrameLayout android:id="@+id/frame_map"
android:layout_weight="3" android:layout_width="0px"
android:paddingLeft="2dip"
android:layout_height="fill_parent">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/screen" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
</RelativeLayout>
</FrameLayout>
</LinearLayout>
欲布局之间切换1 < - >布局2.
这是目前实现这样的:
FragmentTransaction transaction = getSupportFragmentManager()
.beginTransaction();
transaction.setCustomAnimations(android.R.anim.fade_in,
android.R.anim.fade_out);
Fragment fragment = getSupportFragmentManager().findFragmentById(id);
if (fragment.isHidden()) {
transaction.show(fragment);
} else {
transaction.hide(fragment);
}
transaction.commit();
隐藏/显示作品 - 但不调整剩余的片段/ framelayout至全屏(A)
如何让剩余的片段填满整个屏幕区域? 我有另一种布局,还是我必须强制(如何?)重新布局?
thx任何输入
BBBBBBBBBAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAA ...什么? –
对不起,但我无法添加图片来显示场景:BBBB是framelayout1中的fragment1 AAAAA是framelayout2中的fragment2 - 请参阅layout xml。最初有两个并排的fragement。但我想以编程方式显示/隐藏其中一个,并让剩余的一个填充整个屏幕 – furykid