【发布时间】:2016-12-01 09:28:56
【问题描述】:
我正在开发一个 android 应用程序,并且正在使用屏幕顶部的工具栏和屏幕底部的导航栏。我正在使用单个活动来创建顶部和底部工具栏和片段以更改工具栏之间的内容。但是,当片段中的内容超出屏幕大小时,底部栏会消失。
这是我的家庭活动 xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_home"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.rentables.testcenter.HomeActivity">
<include
android:id="@+id/toolbar_main"
layout="@layout/toolbar_main"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<fragment android:name="com.rentables.testcenter.HomeFragment"
android:id="@+id/fragment_place"
android:layout_weight="0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout="@layout/fragment_home" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="bottom">
<include
android:id="@+id/toolbar_navigate"
layout="@layout/toolbar_navigate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|bottom"/>
</LinearLayout>
</LinearLayout>
我猜这是因为我有内部线性布局,但我不确定如何让导航栏在底部保持静态。任何帮助都是极好的。谢谢
【问题讨论】:
标签: android android-layout android-fragments