我使用协调器布局作为活动的根布局(activity_main,其布局代码如下)。在这里面我有一个android coordinatorLayout + tabLayout(底部)+ viewPager发生错误
- AppBarLayout里面有一个工具栏
- ViewPager
- TabLayout
问题是我的viewpager有recyclerView/cardview描述数据的列表和最后一个元素在列表中被tabLayout覆盖。任何解决方案(目前最小的版本一起工作是豆形软糖,但这以下的棒棒糖) click here to view screen with error
<?xml version="1.0" encoding="utf-8"?>
<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.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay">
</android.support.v7.widget.Toolbar>
</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.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/container"
android:background="?attr/colorPrimary"
android:layout_gravity="bottom"
app:tabMode="fixed"
app:tabGravity="fill"
app:tabMaxWidth="0dp"
app:tabBackground="@drawable/tab_color_selector"
android:layout_alignParentBottom="true"
app:tabSelectedTextColor="@color/colorPrimary"
app:tabIndicatorColor="@color/colorPrimary" />
它的工作! thanx –
欢迎........ – mdDroid