Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 无法在react native for<;中查看UI;文本输入>;_Reactjs_React Native_User Interface_Textinput - Fatal编程技术网

Reactjs 无法在react native for<;中查看UI;文本输入>;

Reactjs 无法在react native for<;中查看UI;文本输入>;,reactjs,react-native,user-interface,textinput,Reactjs,React Native,User Interface,Textinput,我从本地人开始。我能够看到。然后我继续添加我的 从“React”导入React; 从“react native”导入{样式表、文本、视图、文本输入}; 导出默认类应用程序扩展组件{ 状态={ 地名:“” } placeNameChangedHandler=事件=>{ 警报(事件) } render(){ 返回( 艾曼 ); } } const styles=StyleSheet.create({ 容器:{ 弹性:1, 背景颜色:“#fff”, 对齐项目:“居中”, 为内容辩护:“中心”, },

我从本地人开始。我能够看到
。然后我继续添加我的

从“React”导入React;
从“react native”导入{样式表、文本、视图、文本输入};
导出默认类应用程序扩展组件{
状态={
地名:“”
}
placeNameChangedHandler=事件=>{
警报(事件)
}
render(){
返回(
艾曼
);
}
}
const styles=StyleSheet.create({
容器:{
弹性:1,
背景颜色:“#fff”,
对齐项目:“居中”,
为内容辩护:“中心”,
},
});
我可以捆绑我的Javascript应用程序,但UI显示一个空白屏幕


请注意,我是一名新手,我正在手机上为UI设备使用
expo

TextInput
样式中添加
borderWidth:1
,它将显示空的TextInput。

可以添加屏幕截图吗?您可以尝试设置
TextInput
值和占位符初始值。
import React from 'react';
import { StyleSheet, Text, View, TextInput } from 'react-native';

export default class App extends Component {

  state = {
    placeName: ''
  }

  placeNameChangedHandler = event => {
    alert(event)
  }

  render(){
    return (
      <View style={styles.container}>
        <Text>Ayman</Text>
        <TextInput 
          style={{width:300, borderColor:"black"}}
          value={this.state.placeName}
          onChangeText={this.placeNameChangedHandler}
        />
      </View>
    );
  }

}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});