【发布时间】:2021-01-29 23:04:25
【问题描述】:
我的react-native-paper 组件textInput 没有拉出我设置的字体。
<View style={styles.inputCon}>
<TextInput
multiline={true}
label="Ime aktivnosti"
mode="outlined"
value={ime}
onChangeText={(value) => {
setIme(value);
}}
/>
</View>
我已经按照官方文档了解如何更改 RN Paper 组件的字体https://callstack.github.io/react-native-paper/fonts.html
const fontConfig = {
default: {
regular:{
fontFamily: "Poppins_400Regular",
fontWeight:'normal'
},
medium: {
fontFamily: "Poppins_500Medium",
fontWeight:'normal'
},
light: {
fontFamily: "Poppins_300Light",
fontWeight:'normal'
},
thin: {
fontFamily: "Poppins_200ExtraLight",
fontWeight:'normal'
},
bold: {
fontFamily: "Poppins_700Bold",
fontWeight:'normal'
}
},
};
const theme = {
...DefaultTheme,
fonts: configureFonts(fontConfig),
};
同样来自react native paper 的另一个组件正确拉取字体
<Searchbar
placeholder="Type here..."
onChangeText={text => this.searchItems(text)}
value={this.state.value}
/>
【问题讨论】:
标签: reactjs react-native react-native-paper