简体   繁体   English

反应本机后退按钮缺少图标

[英]React native back button missing icon

I'm developing a react native module for an existing mobile app, using react-navigation component: 我正在使用react-navigation组件为现有的移动应用程序开发一个react本机模块:

import { StackNavigator } from 'react-navigation';
....

const App = StackNavigator({
    Main: {
        screen: Main,
        navigationOptions: {
            headerBackTitle: null,
        }
    },
    Details: {
        screen: Details,
        navigationOptions: {
           headerBackTitle: null,
        }
    }

});

In Main index I render a simple button that on click do this: 在主索引中,我渲染一个简单的按钮,点击这样做:

render() {

        const navigation = this.props.navigation;

        return (
            <View>
                <Button
                    title="Go to details"
                    onPress={() => { navigation.navigate("Details") }}
                />
            </View>
        );
    }

That's it. 而已。

The issue is that the navigation back button is invisible (see image): 问题是导航后退按钮是不可见的(见图):

在此输入图像描述

This happen after this operations: 这个操作发生后会发生:

  • Copying bundle in android project . 在android项目中复制bundle。

     react-native bundle --platform android \\ --dev false --entry-file index.js --bundle-output ../MyApp/app/src/main/assets/index.android.bundle \\ --assets-dest ../MyApp/app/src/main/ 
  • Launching app from Android studio 从Android工作室启动应用程序

Any advice? 有什么建议?

navigationOptions: ({ navigation }) => ({
      headerLeft: drawerButton(navigation)
})

const drawerButton = navigation => (
    <TouchableOpacity onPress={() => navigation.navigate("DrawerToggle")}>
        <Image source={Your.image} style={Your.Style} />
    </TouchableOpacity>
);

Use this code! 使用此代码!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM