android tablayout垂直,垂直Android TabLayout不能垂直滚动
I try to develop left TabLayout like this image.但是问题是TabLayout元素没有显示并垂直滚动.下面是我的代码,也许我错过了一些东西:xmlns:app="http://schemas.android.com/apk/res-auto"android:layout_width="match_parent"android:layout_height
I try to develop left TabLayout like this image.
但是问题是TabLayout元素没有显示并垂直滚动.下面是我的代码,也许我错过了一些东西:
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toRightOf="@+id/appBarLay"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
android:id="@+id/appBarLay"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
android:id="@+id/tabs"
android:layout_width="60dp"
android:layout_height="match_parent"
app:tabBackground="@drawable/tab_color_selector"
app:tabGravity="fill"
app:tabMode="scrollable" />
解决方法:
如android文档中所述,请参阅this
TabLayout provides a horizontal layout to display tabs.
这意味着您不能使用TabLayout显示垂直选项卡.但是,您可以使用TabHost来实现它.
看看这些喜好:
标签:tabs,slider,android,scroll
来源: https://codeday.me/bug/20191111/2023060.html
更多推荐
所有评论(0)