YaS*_*ary 1 android react-native react-navigation expo create-react-native-app
我正在使用create-react-native-app。我想使用react-native-vector-icons
但它没有在 android 屏幕上显示任何内容(我在 expo 应用程序上查看它)
这是我所做的:
应用程序.js:
const Courses = TabNavigator({
ReactCourses: { screen: ReactCourses },
NativeCourses: { screen: NativeCourses },
}, {
tabBarOptions: {
activeTintColor: '#e91e63',
swipeEnabled: true,
showIcon:true,
},
});
Run Code Online (Sandbox Code Playgroud)
ReactCourses.js:
import Icon from 'react-native-vector-icons/MaterialIcons';
static navigationOptions = {
tabBarLabel: 'React Courses',
tabBarIcon:({ tintColor }) => (
<Icon
name={'home'}
size={26}
style={[styles.icon, {color: tintColor}]} />
)
}
Run Code Online (Sandbox Code Playgroud)
Nav*_*sad 10
在 android/app/build.gradle 添加以下内容
适用于:“../../node_modules/react-native-vector-icons/fonts.gradle”
然后执行命令
react-native run-android
| 归档时间: |
|
| 查看次数: |
9327 次 |
| 最近记录: |