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中所做的替换。