喷气背包撰写"Text"函数已弃用 (1.0.0-alpha09)



Jetpack可组合功能";文本";已弃用

Text( // <===== Strikethrough in Android Studio
text = "Anna"
)

但我不知道怎么替换。医生说用。。。文本

@Deprecated(
message = "Use androidx.compose.material.Text for a high level Text component that " +
"consumes theming information, or androidx.compose.foundation.text.BasicText for a basic " +
"unopinionated component that does not have default theming",
replaceWith = ReplaceWith(
"Text(text, modifier, color, fontSize, fontStyle, fontWeight, fontFamily, " +
"letterSpacing, textDecoration, textAlign, lineHeight, overflow, softWrap, maxLines, " +
"onTextLayout, style)",
"androidx.compose.material.Text"
)
)

androidx.compose.foundation.Text导入更改为

import androidx.compose.material.Text

使用Text的非弃用Material版本,这是Text在以前的Alpha中所做的替换。

最新更新