在Android Wear 2.0中创建自定义滚动条 [英] Create Custom Scroll Bar in Android Wear 2.0
问题描述
有没有办法像这样在Android Wear 2.0中使用自定义滚动条创建WearableRecyclerView?
Is there any way to create a WearableRecyclerView with a custom scroll bar in Android Wear 2.0 like this?
推荐答案
要在可穿戴式应用中为可滚动项创建弯曲的布局,请检查以下链接:
To create a curved layout for scrollable items in your wearable app check below link:
https://developer.android.com/ training / wearables / ui / lists.html#creating
使用
val layoutManager = CurvedChildLayoutManager (此)
recyclerView.layoutManager = layoutManager
val layoutManager = CurvedChildLayoutManager(this) recyclerView.layoutManager = layoutManager
PS:至于主题问题,您不需要app:layout_box,只需在上面使用android:scrollbars = vertical您的WearableRecyclerView
PS: as for topic question, you dont need app:layout_box just use android:scrollbars="vertical" on your WearableRecyclerView
https://developer.android.com/reference/android/support/wearable/view/CurvedChildLayoutManager.html
这篇关于在Android Wear 2.0中创建自定义滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!