[英]React native back button missing icon
我正在使用react-navigation組件為現有的移動應用程序開發一個react本機模塊:
import { StackNavigator } from 'react-navigation';
....
const App = StackNavigator({
Main: {
screen: Main,
navigationOptions: {
headerBackTitle: null,
}
},
Details: {
screen: Details,
navigationOptions: {
headerBackTitle: null,
}
}
});
在主索引中,我渲染一個簡單的按鈕,點擊這樣做:
render() {
const navigation = this.props.navigation;
return (
<View>
<Button
title="Go to details"
onPress={() => { navigation.navigate("Details") }}
/>
</View>
);
}
而已。
問題是導航后退按鈕是不可見的(見圖):
這個操作發生后會發生:
在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/
從Android工作室啟動應用程序
有什么建議?
navigationOptions: ({ navigation }) => ({
headerLeft: drawerButton(navigation)
})
const drawerButton = navigation => (
<TouchableOpacity onPress={() => navigation.navigate("DrawerToggle")}>
<Image source={Your.image} style={Your.Style} />
</TouchableOpacity>
);
使用此代碼!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.