Kev*_*lia 5 android scrollbar android-tv leanback
我正在开发一个使用 Leanback lib 的 Android TV 项目。
我想要实现的目标是使 VerticalGridView ( androidx.leanback.widget.VerticalGridView
) 中内置的垂直滚动条可见。
<androidx.leanback.widget.VerticalGridView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:fadeScrollbars="false"
android:scrollbarThumbVertical="@color/color_green"
app:fastScrollVerticalThumbDrawable="@drawable/scrollbar_vertical_thumb"
android:scrollbarSize="5dp"
style="?attr/rowsVerticalGridStyle" />
Run Code Online (Sandbox Code Playgroud)
如图所示,我尝试设置滚动条大小、可绘制、缩略图样式以及所有其他可能的属性以使滚动条可见。
现在的悲剧是,当我调用verticalGridView.getVerticalScrollbarWidth();
方法来检查宽度时,它返回了0
。看来 Leanback lib 正在将 VerticalScrollbarWidth 设置为0
我找不到的某个地方。
我还尝试查看其他 Leanback 应用程序,尽管视图是可滚动的,但没有应用程序显示滚动条拇指。
为什么??有什么方法可以向我的用户展示 Android TV 应用程序上的滚动条吗?