android tablayout垂直,垂直Android TabLayout不能垂直滚动

I try to develop left TabLayout like this image.

ce8ffb57ae8e9d1cd8f4dfab1aa45c92.png

但是问题是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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值