反应本机菜单页面

时间:2018-10-08 01:31:04

标签: javascript reactjs react-native

我创建了一个新的页面调用:Privacy.js(保存在/ App / Components / Privacy

然后,我在用户个人资料中创建页面菜单。当我单击打开的Privacy.js,但在我的代码中显示“未定义”时。

Language.js

// user profile
userProfileName: 'Name',
userProfileEmail: 'Email',
userProfileAddress: 'Address',
userProfileWishlist: 'Wishlist',
userProfileLanguages: 'Languages',
userProfilePushNotif: 'Push notification',
userProfilePrivacy: 'Privacy',
userProfileContact: 'Contact us',
userProfileAbout: 'About us',
userProfileItems: 'items',
chatList: 'Chat List',

index.js

import ChatScreen from './ChatScreen'
import LoginScreen from './LoginScreen'
import ChatListScreen from './ChatListScreen'
import Privacy from './Privacy'

Privacy.js

import * as React from 'react';
import { ScrollView, View, Text, Image, StyleSheet } from 'react-native';

export default class Article extends React.Component<*> {
  render() {
    return (
      <ScrollView
        style={styles.container}
        contentContainerStyle={styles.content}
      >
        <View style={styles.author}>

          <View style={styles.meta}>

          </View>
        </View>

        <Text style={styles.title}>Privacy Policy.</Text>
        <Text style={styles.paragraph}>
        We collect certain information that you provide to us when you use our services, such as when you create an 
    account. This may include your name, email, contact number and location.If you create an account using your 
    Facebook account,we will access and collect the information that your privacy settings on that account permit 
    us to access so that we can create Indiansbiz account for you. 
        </Text>
        <Image style={styles.image} source={require('../images/aboutus.png')} />
        <Text style={styles.paragraph}>
        If you would like us to delete your personal information from our system, please contact us at xx.
    We will use commercially reasonable efforts;however, we may retain an archived copy of your records as required by law 
    or for other legitimate business purposes.{"\n"}
{"\n"}Read our Privacy Policy at xx
        </Text>

      </ScrollView>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    backgroundColor: 'white',
  },
  content: {
    paddingVertical: 16,
  },
  author: {
    flexDirection: 'row',
    marginVertical: 8,
    marginHorizontal: 16,
  },
  meta: {
    marginHorizontal: 8,
    justifyContent: 'center',
  },
  name: {
    color: '#000',
    fontWeight: 'bold',
    fontSize: 16,
    lineHeight: 24,
  },
  timestamp: {
    color: '#999',
    fontSize: 14,
    lineHeight: 21,
  },
  avatar: {
    height: 48,
    width: 48,
    borderRadius: 24,
  },
  title: {
    color: '#000',
    fontWeight: 'bold',
    fontSize: 30,
    marginVertical: 8,
    marginHorizontal: 16,
  },
  paragraph: {
    color: '#000',
    fontSize: 14,
    lineHeight: 24,
    marginVertical: 8,
    marginHorizontal: 16,
  },
  image: {
    width: '100%',
    height: 150,
    resizeMode: 'cover',
    marginVertical: 8,
  },

});

1 个答案:

答案 0 :(得分:0)

“未定义”表示您的代码中缺少某些内容。尝试检查您的资源,变量或状态,