2

导入字体时遇到问题,它返回错误:Unhandled Rejection (Error): Could not resolve font for undefined, fontWeight 400

import OpenSanSrc from 'assets/font/OpenSans-Regular.ttf';
Font.register({
 family: 'Open Sans',
 src: OpenSanSrc,
})

并申请这样的页面样式:

const styles = StyleSheet.create({
  page: {
    paddingVertical: 45,
    paddingHorizontal: 35,
    backgroundColor: '#E4E4E4',
    fontFamily: 'Open Sans'
  },
}

有人对此有想法吗?任何帮助,将不胜感激

4

0 回答 0