Jee*_*cha 6 android android-jetpack-compose android-compose-textfield
使用Jetpack Compose Text()时,我无法更改fontWeightmore thanFontWeight.W600和FontWeight.W500. 除了这两个之外,没有像 、 等应用FontWeight.W700。FontWeight.Bold我FontWeight(550)试图创建太暗的文本,但根本无法实现。注意:我使用的是来自谷歌可下载字体的Roboto字体和.material theme 3
One example of text code:-
Text(
modifier = Modifier.padding(top = 4.dp),
text = "This should be too bold",
style = MaterialTheme.typography.titleSmall,
fontWeight = FontWeight.Black,
)
Run Code Online (Sandbox Code Playgroud)
@Composable
fun BoldText() {
Text("Hello World", fontWeight = FontWeight.Bold)
}
Run Code Online (Sandbox Code Playgroud)
如果您需要其他样式(来自Material Design 3 文档):
Text(
text = "Hello World",
style = MaterialTheme.typography.displayLarge,
color = MaterialTheme.colorScheme.primary,
)
Run Code Online (Sandbox Code Playgroud)
您还可以尝试通过手动选择样式从Google Fonts下载字体Black 900:
| 归档时间: |
|
| 查看次数: |
4558 次 |
| 最近记录: |