![](/img/trans.png)
[英]How to animate the progress of a LinearProgressIndicator in Jetpack Compose?
[英]Vertical LinearProgressIndicator in Jetpack Compose
我想展示一個垂直的LinearProgressIndicator
,意思是全高,小寬度,從上到下動畫。 我試圖簡單地將它旋轉 90°,這令人驚訝地以某種方式起作用,例如:
Modifier
.height(8.dp)
.fillMaxWidth()
.graphicsLayer {
rotationZ = 90f
transformOrigin = TransformOrigin(0f, 0f)
}
但它似乎僅限於 Composable 的寬度,因此不會填充整個高度。 更改修飾符的順序或使用width
/ fillMaxHeight
也不起作用。
LinearProgressIndicator
是根據Material Guidelines設計的,它只包含一個水平進度指示器。
對於垂直指示器,您必須創建自己的元素。 您可以以LinearProgressIndicator
源代碼為例,它非常簡單。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.