jetpackcompose
致力于在 Android Studio 4.0 Canary 中理解 android 。
我有一个简单的jetpackcompose
设置,VerticalScroller
如下所示:
@Composable
fun MyScreenContent(appState: AppState = AppState())
{
FlexColumn{
flexible(flex = 1f){
VerticalScroller {
Column {
CardDemo()
CardDemo()
CardDemo()
CardDemo()
CardDemo()
CardDemo()
CardDemo()
CardDemo()
CardDemo()
CardDemo()
CardDemo()
CardDemo()
CardDemo()
CardDemo()
CardDemo()
CardDemo()
CardDemo()
CardDemo()
CardDemo()
}
}
}
}
}
它滚动完美,但我想要一个scrollindicator
显示我的列表滚动了多远,我如何打开它,找不到任何ScrollIndicator
(即)要包含的组件。
参考。在可见RecyclerView
的不可组合设置(xml)中:scrollindicator
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/station_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/recyclerview_background_color"
android:clipChildren="true"
android:clipToPadding="false"
android:fadeScrollbars="false"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:scrollbarSize="4dp"
android:scrollbarThumbVertical="@color/colorPrimary" <---
android:scrollbars="vertical" <---
android:visibility="visible"
app:isGone="@{!hasStations}"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintStart_toStartOf="parent"
tools:context="no.rogo.projectfk303.ui.activities.MainActivity"
tools:listitem="@layout/list_item_station" />