u2g*_*les 1 android text android-jetpack-compose
(配置:compose_version = '1.0.0-alpha09' kotlin_version = “1.4.21”)
Jetpack Composable 函数“Text”已弃用
Text( // <===== Strikethrough in Android Studio
text = "Anna"
)
Run Code Online (Sandbox Code Playgroud)
但我不知道如何更换它。文档说替换为 ... 文本
@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"
)
)
Run Code Online (Sandbox Code Playgroud)
将您的androidx.compose.foundation.Text导入更改为
import androidx.compose.material.Text
Run Code Online (Sandbox Code Playgroud)
使用未弃用的 Material 版本Text,这是对Text之前 alpha版本的替代。
| 归档时间: |
|
| 查看次数: |
262 次 |
| 最近记录: |