【发布时间】:2016-06-15 12:21:30
【问题描述】:
我想在焦点 TextInput 动画上显示一个取消 (iptal) 按钮?
我做了以下代码,但没有成功:
constructor(props) {
super(props);
this.state = { cancelBtn:this.cancelBtn()};
}
cancelBtn(){
return (<TouchableHighlight style={styles.searchTouch} onPress={this.press()}>
<Text style={styles.searchBarText}>İptal</Text>
</TouchableHighlight>);
}
render(){
<View style={styles.searchBar}>
<View style={styles.searchBarBox}>
<TextInput
ref="searchBarInput"
style = {styles.searchBarInput}
placeholder = 'Mekan Ara...'
/>
</View>
{this.state.cancelBtn}
</View>
}
我如何以动画方式做到这一点?
图片: s.s.1 => http://i.stack.imgur.com/m7wxm.png
s.s.2 => http://i.stack.imgur.com/hYa3z.png
【问题讨论】:
-
您是要为其制作动画还是仅根据焦点显示/隐藏?
-
焦点输入文本输入按钮要变短并出现取消按钮。
标签: animation reactjs react-native textinput