が所定の空き領域を残す:Androidの表示/非表示断片は
- 最初現在選択されている断片(ViewFlipper)で
- 処置テキストベース切り替わり画面上の2つの垂直に配置された要素(ViewPagerおよびフラグメント) WebViewベースのビューを表示し、下部のフラグメントを非表示/表示します。観測
:
- 底断片を非表示には、底断片が配置されている空き領域を残します。
下の断片を除去した後、私はまだ下
上の空きスペースを持ってここでトップレベルのレイアウトファイルだ私は(weight=1
にセットトップ断片と)相対とのLinearLayoutの両方を試してみましたが、両方は効果がありません:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="fill_parent"
android:layout_height="0dip" android:layout_weight="1"/>
<!-- This gets replaced with appropriate fragment at run time -->
<LinearLayout
android:id="@+id/scrollFragmentPlaceholder"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="110dip" />
</LinearLayout>
ここフラグメント
Fragment scroll = getSupportFragmentManager().findFragmentById(R.id.scrollFragment);
if (scroll.isHidden() == isWebView)
return; // already handled, do nothing
FragmentTransaction tr = getSupportFragmentManager().beginTransaction();
if (scroll != null && scroll.isAdded()) {
if (isWebView) {
tr.hide(scroll);
} else
tr.show(scroll);
}
tr.commit();
そして、ここを切り替えコードがありますどのように見えるの:
は、あなたが(* .MEASUREをやってみました作業するためのフラグメントを表示/非表示にしたい
注)のままのビューに? – Codeman
実際にはそうではありませんが、注文を裏返してテキストのバージョン/隠しボトムが正しく表示されていれば – Bostone
アンドロイドのWebViewは血まみれです。いくつかのスクリーンショットを追加して、具体的に何を話しているのか分かりますか?また、両方のビューでlayoutWeight = 1を使用する必要がある場合は、両方のビューでlayoutWeight = 1を使用する必要があります。親ビューでorientation = "vertical"を指定する必要があります。 – Codeman