fun px2dp(scale: Float, px: Int): Int {
// val scale = resources.displayMetrics.density
return (px / scale + 0.5f).toInt()
}
@Composable
fun GradientText(
text: String,
textSize: Int = 24,
gradientShader: (Rect) -> Shader = {
LinearGradientShader(
from = Offset(0f, 0f
Android Compose 渐变色Text
最新推荐文章于 2024-09-23 16:49:34 发布