没有显示本机导航Android标签栏图标

时间:2018-11-20 21:27:11

标签: android react-native react-native-navigation wix-react-native-navigation

我正在为我的项目使用react-native-navigation,当我尝试在Android中使用Drawables显示图标时遇到问题,但是在IOS中,当我设置Xassets时它会完美工作。

IOS模拟器 IOS simulator

Android模拟器 Android simulator

我按照说明操作,并为Android创建了所有Drawable(hdpi,mdpi,xhdpi,xxhdpi,xxxhdpi)

我在Visual Studio代码中的存档示例

Example of my archives in visual studio code

我在android studio中的存档示例

Example of my archives in the android studio


我的图标的名称是:icon_home.png

我的代码

tabs: [{
    //HomeMenu
    screen: "myMenu.MainMenu",
    title: "",
    label: "",
    showIcon: true,
    icon: {uri: 'icon_home', scale: 6},
    //selectedIcon: {uri: 'homeicons',scale: 6},
    navigatorStyle: { //add this to change top bar navigator.
        drawUnderNavBar: true,
        navBarTranslucent: true,
        navBarTransparent: true,
        navBarBackgroundColor: 'transparent',
        topBarElevationShadowEnabled: false
    },
    iconInsets: { // add this to change icon position (optional, iOS only)
        top: 0, // optional, default is 0.
        left: 0, // optional, default is 0.
        bottom: -12, // optional, default is 0.
        right: 0 // optional, default is 0.
    }
}]

样式的Android

appStyle: { //Android 
    tabBarButtonColor: '#6c6d70',
    tabBarBackgroundColor: '#cccc',
    tabBarSelectedButtonColor: 'rgb(50, 184, 201)',
    showIcon: true
},

我在这个框架中还很新,我希望有人可以帮助我,因为我在这一点上停留了两天,我的最后选择是将我的图标像图像一样导入。

0 个答案:

没有答案