0
class Main extends Component {
constructor(props) {
super(props)
this.state = {
id: '',
password: '',
}
console.log('yes')
this._handleTextChange = this._handleTextChange.bind(this)
}
_handleTextChange(id, text) {
console.log(text)
var newState = Object.assign({}, this.state);
var newState = Object.assign({}, this.state);
newState[id] = text
this.setState(newState)
}
render() {
console.log('ass')
return (
<View style={MainStyle.justFlexOne}>
<View style={MainStyle.coverImageWrapper}>
<Image source={require('../assets/images/cursive.jpg')} style={MainStyle.coverImage}/>
</View>
<View style={MainStyle.mainBackground}>
<TouchableHighlight>
<Text style={MainStyle.bigFontDefault}>
Comma
</Text>
</TouchableHighlight>
<TextInput
style={MainStyle.TextInputs}
value={this.state.id}
editable={true}
onChangeText={(text) => {console.log('asdf');this.setState({id:text})}}
placeholder='text'
/>
</View>
</View>
)
}
}
const MainStyle = StyleSheet.create({
justFlexOne: {
flex: 1,
},
mainBackground: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'transparent',
},
bigFontDefault: {
color: '#fafafa',
fontSize: 60,
textShadowOffset: {width: 0, height: 1},
textShadowRadius: 8,
textShadowColor: 'rgba(21,42,55,0.4)',
fontFamily: 'Optima-Italic',
fontWeight: '500',
},
coverImageWrapper: {
position: 'absolute',
top: 0, left: 0, bottom: 0, right: 0,
},
coverImage: {
flex: 1,
width: null,
height: null,
resizeMode: 'cover',
},
textInputs: {
height: 40,
width: 200,
color: '#fcc439',
backgroundColor: 'rgba(0,0,0,0.4)',
borderColor: '#fcc439',
}
})
問題是,我不能聚焦成的TextInput上iPhone模擬器通過的XCode操作(版本8.2.1)。(這意味着在我不能鍵入一些字符輸入。)我已經完成了我可以使用mac鍵盤,觸控板,甚至蘋果鼠標,我可以處理(如點擊,輸入等...)。儘管連接硬件鍵盤已打開。陣營本機無法在的TextInput集中
而且樣式表不上的TextInput正常工作。(它的工作原理以及其他組件。)
我怎樣才能解決這個問題?
謝謝了,請原諒我的疏忽。 – HyeonJunOh
괜찮아요!!!!!!!!!! – vinayr
여기서한국인을다만나네요。 ㅎㅎ감사합니다:) – HyeonJunOh