有没有办法添加滚动条来添加LazyColumn
(ScrollableColumn
已弃用)。Javadoc 没有提到有关 Jetpack Compose 中滚动条的任何内容。
澄清一下,这是我想要实现的设计:
甚至可以在 Jetpack Compose 中做到这一点吗?或者不支持滚动条?
在基于 XML 的图像中,我们可以按照https://medium.com/mobile-app-development-publication/android-matrix-scaletype-explained-4501f0796be8拥有矩阵缩放类型,这是一种可以执行的非常强大的自定义缩放类型在图像上。
然而,在 JetpackCompose 图像中,我们不再有 Matix Scale。相反,contentScale
Image(imagePicture,
contentDescription = null,
modifier = Modifier.fillMaxSize(),
alignment = alignment.alignment,
contentScale = scale.scaleType // the scale here
)
Run Code Online (Sandbox Code Playgroud)
仅具有此处列出的https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale,即 Crop、Fit、FillWidth、FillHeight、FillBounds、Fit、Inside 和 None。
如何在 JetpackCompose 中实现 Matrix Scale?
我正在寻找 jetpack compose 中的阿拉伯符号支持。我想更改一些阿拉伯标点符号的颜色并自定义它们的外观。目前,我正在使用此功能来实现此目的:
\nprivate fun colorPonctuation(input: String): AnnotatedString {\n return buildAnnotatedString {\n input.forEach {\n if (it == \'\\u064B\' || it == \'\\u064D\'\n || it == \'\\u064D\' || it == \'\\u064E\' || it == \'\\u064F\' ||\n it == \'\\u0650\' || it == \'\\u0651\' || it == \'\\u0652\' || it == \'\\u0653\' ||\n it == \'\\u0654\' || it == \'\\u0655\' || it == \'\\u0656\' || it == \'\\u0657\' ||\n it == \'\\u0658\' || it == \'\\u0659\' || it == \'\\u065A\' …
Run Code Online (Sandbox Code Playgroud)