我如何阻止我的 TabLayout 剥离我的其他视图
How do i stop my TabLayout from stripping my other view
()
我如何阻止这种情况发生?,我在选项卡布局顶部有一个视图寻呼机,基本上我使用的是片段(请检查上面附加的图像 link)
<RelativeLayout
android:id="@+id/root1"
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"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.v4.view.ViewPager
android:id="@+id/simpleViewPager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/toolbar"/>
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
app:tabMode="fixed"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="6dp"
app:tabTextColor="@android:color/darker_gray"
app:tabBackground="@android:color/white"
app:tabSelectedTextColor="#ff00ff"
app:tabIndicatorColor="#ff00ff"
android:minHeight="?attr/actionBarSize"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>
我应该使用 NestedScrollView 而不是相对布局,这会有帮助吗??
任何帮助将不胜感激
在 ViewPager
上添加 android:layout_above="@+id/tabLayout"
并从 tabLayout
的 id 声明中删除 +
:android:id="@id/tabLayout"
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_below="@+id/simpleViewPager"
app:tabMode="fixed"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:elevation="6dp"
app:tabTextColor="@android:color/darker_gray"
app:tabBackground="@android:color/white"
app:tabSelectedTextColor="#ff00ff"
app:tabIndicatorColor="#ff00ff"
android:minHeight="?attr/actionBarSize"
android:layout_alignParentBottom="true"
/>
(
我如何阻止这种情况发生?,我在选项卡布局顶部有一个视图寻呼机,基本上我使用的是片段(请检查上面附加的图像 link)
<RelativeLayout
android:id="@+id/root1"
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"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.v4.view.ViewPager
android:id="@+id/simpleViewPager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/toolbar"/>
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
app:tabMode="fixed"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="6dp"
app:tabTextColor="@android:color/darker_gray"
app:tabBackground="@android:color/white"
app:tabSelectedTextColor="#ff00ff"
app:tabIndicatorColor="#ff00ff"
android:minHeight="?attr/actionBarSize"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>
我应该使用 NestedScrollView 而不是相对布局,这会有帮助吗??
任何帮助将不胜感激
在 ViewPager
上添加 android:layout_above="@+id/tabLayout"
并从 tabLayout
的 id 声明中删除 +
:android:id="@id/tabLayout"
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_below="@+id/simpleViewPager"
app:tabMode="fixed"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:elevation="6dp"
app:tabTextColor="@android:color/darker_gray"
app:tabBackground="@android:color/white"
app:tabSelectedTextColor="#ff00ff"
app:tabIndicatorColor="#ff00ff"
android:minHeight="?attr/actionBarSize"
android:layout_alignParentBottom="true"
/>