目前,我正在将我的一个应用迁移到完全使用Jetpack Compose编写的Material Design 3中。
在使用Material Design 2时,我可以使用以下代码更改文本的重点。
CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.medium) {
Text(
text = "Hello, world",
style = MaterialTheme.typography.h6,
fontWeight = FontWeight.SemiBold,
)
}
然而,同样的代码在Material Design 3中不起作用,文本具有默认的强调。此外,我无法找到任何与Material Design 3相关的函数。我想知道是否有任何官方方法来实现相同的效果。