native-base的字体问题Roboto_medium
把native-base中的Fonts文件夹放到项目的根目录.
import {Font,AppLoading} from 'expo';
import {Root} from 'native-base';
export default class App extends React.Component {
constructor(){
super();
this.state={
loading:true
}
}
async componentWillMount() {
await Expo.Font.loadAsync({
'Roboto': require('./Fonts/Roboto.ttf'),
'Roboto_medium': require('./Fonts/Roboto_medium.ttf'),
});
this.setState({
loading:false
});
}
render() {
if(this.state.loading){
return (
<Root>
<AppLoading/>
</Root>
)
}
return ()
}