0
私は断片とでframeLayout listContainerを交換する以下のレイアウトがあります。ツールバーの視認性をなくすためにフレームレイアウトのサイズを変更しますか?
<RelativeLayout
android:id="@+id/content_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|bottom"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_alignParentTop="true"
android:background="@color/colorPrimary"
android:elevation="4dp"
android:theme="@style/ToolBarStyle"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<TextView
android:id="@+id/appTitle"
android:layout_width="@dimen/toolbar_title_width"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textColor="@color/colorTitleFont"
android:textStyle="bold"
android:ellipsize="end"
android:layout_gravity="center"/>
</android.support.v7.widget.Toolbar>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar"
android:orientation="vertical">
<LinearLayout
android:id="@+id/content_view_panes"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<WebView
android:id="@+id/mainWebView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:visibility="gone" />
<FrameLayout
android:id="@+id/listContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
<RelativeLayout
android:id="@+id/saveCancelBar"
android:layout_width="match_parent"
android:layout_height="@dimen/save_cancel_bar_height"
android:background="@color/fluxx_blue"
android:visibility="gone">
<Button
android:id="@+id/editorCancelButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:background="@color/fluxx_blue"
android:text="@string/editor_cancel"
android:textColor="@color/white"
style="?attr/borderlessButtonStyle"/>
<Button
android:id="@+id/editorSaveButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@color/fluxx_blue"
android:text="@string/editor_save"
android:textColor="@color/white"
style="?attr/borderlessButtonStyle" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
私のフラグメントは、ツールバーを隠す必要です。私は、フラグメントのonResume()メソッドのツールバーでsetVisibility(View.GONE)を呼び出します。バックプレスを使用してフラグメントに移動するときに非表示にする必要があります。しかし、私がツールバーを隠すと、私の断片は画面全体を占めることはありません。おそらく、これはツールバーを削除し、ツールバーの高さだけすべてをシフトするためです。しかし、私のFrameLayoutは1のlayout_weightを持っています。私はそれがスクリーンを満たすために伸びると考えていました。どのようにサイズを変更することができますか?