我想在TextInput
时更改onFocus()
的填充,但我失败了。有谁知道为什么?
以下是我的代码。
constructor(props) {
super(props);
this.state = {
textInputStyle: {
paddingLeft: 0,
}
};
};
setPadding = () => {
this.setState({
textInputStyle: {
paddingLeft: 40,
}
})
};
render() {
return (
<TextInput
style={this.state.textInputStyle}
onFocus={this.setPadding}
/>
);
};