标签:imageview auto tor struct 加载 this images false async
把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 ()
}
标签:imageview auto tor struct 加载 this images false async
原文地址:https://www.cnblogs.com/zhongchao666/p/9567482.html