我正在为我的class创建一个基本的 React Native 应用程序,但遇到了问题。我正在尝试在我的视图中实现堆栈导航,但由于某种原因它没有显示蓝色堆栈按钮。有可能这样做吗?
import React,{Component} from 'react';
import {View, Text, StyleSheet, Image} from 'react-native';
import { createStackNavigator } from '@react-navigation/stack';
import Home from '../views/Home.js'
let stack = createStackNavigator();
class Account extends Component{
render(){
return(
<View style = {styles.container} >
<Text style = {styles.PageHeader}>TRENDZ</Text>
<Text style = {styles.PageSubHeader}> Online Store</Text>
<Image style = {styles.AccImage} source={require('../../assets/login/login.jpg')} {...this.props} />
<stack.Navigator>
<stack.Screen name = 'Home' component = {Home} />
</stack.Navigator>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
marginTop: 20,
},
AccImage: {
height:600,
width: null
},
PageHeader: {
fontWeight: 'bold',
fontSize: 70,
textAlign: 'center',
color: 'orange'
},
PageSubHeader: {
textAlign: 'center',
fontSize: 25,
paddingBottom: 20
}
})
export default Account;