我的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}
/>