UI通用修饰符
fontWeight
设置可继承的字体字重。
fontWeight(value) 接受 FontWeight 值。它会通过容器视图继承,并覆盖当前字体提供的字重。
import { Font, FontWeight, Modifier, Text, VStack } from "onescript/views"
<VStack modifier={Modifier
.font(Font.body)
.fontWeight(FontWeight.medium)}>
<Text>继承 medium 字重</Text>
<Text modifier={Modifier.fontWeight(FontWeight.bold)}>局部覆盖为 bold</Text>
</VStack>| 值 | 相对字重 |
|---|---|
FontWeight.ultraLight | 100 |
FontWeight.thin | 200 |
FontWeight.light | 300 |
FontWeight.regular | 400 |
FontWeight.medium | 500 |
FontWeight.semibold | 600 |
FontWeight.bold | 700 |
FontWeight.heavy | 800 |
FontWeight.black | 900 |
How is this guide?
最后更新于