【发布时间】:2017-02-12 10:22:02
【问题描述】:
我想为我的选项卡式活动中的所有片段添加横幅。横幅将在页面底部保持不变。
我的项目中有 8 页,我可以为所有片段一个一个添加横幅。但是在这种方法中,我必须为所有片段添加 8 个横幅。我不想要它。我想要一个恒定的横幅底部的所有片段。
感谢您的帮助:)
这是我的 main_activity.xml ;
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.example.aslan.rte3.MainActivity">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/appbar_padding_top"
android:theme="@style/AppTheme.AppBarOverlay"
android:background="@android:color/black">
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabGravity="center"
app:tabMode="scrollable" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:background="#E0DFDE">
</android.support.v4.view.ViewPager>
</android.support.design.widget.CoordinatorLayout>
【问题讨论】:
标签: android android-fragments android-tabs android-tabbed-activity