react-native - 当我在 TextInput 中获得焦点时单击其他元素
问题描述
当我在 TextInput 中打开键盘时。如果我单击其他组件没有响应,并且键盘关闭。
如果键盘打开,如何让其他元素对我的触摸做出反应?
编码:
<View style={{flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }} >
<TouchableOpacity onPress={ () => console.log('aaaa')}>
<Image source={require('Assets/images/icons/back.png')} />
</TouchableOpacity>
<TextInput
style={[{height: 35, textAlignVertical: 'center', paddingTop: 0, paddingBottom: 0, color: 'white'}]}
placeholder="Music expert, company or music style..."
onChangeText={this.changeText}
autoFocus={true}
/>
<TouchableOpacity onPress={ () => console.log('aaaa')}>
<Image source={require('Assets/images/icons/close.png')} />
</TouchableOpacity>
</View>
</View>
如果我专注于 TexInput 并单击任何 ToucableOpacity 这只是关闭键盘,但不显示 console.log
解决方案
推荐阅读
- amazon-s3 - 是否可以分块反序列化 ORC 文件?
- reactjs - 我可以将顺风类名作为 React 中的道具传递吗?
- php - 'pg_connect()' 我需要什么库?
- reactjs - ReactJS 的引导程序
- powershell - 如何在 PowerShell 中解析类似 JSON 的结构?
- visual-studio-2019 - “添加项目数据源”选项在哪里?
- javascript - 将基于类的组件转换为未读取的功能组件输入查询
- office-js - 我可以使用 Outlook 加载项来保存电子邮件并更新用户 PC 上的文件吗
- node.js - 如何使用密码在 Angular 中生成 RSA 密钥对?
- amazon-emr - 带有 EMR addstep 的 aws 步进函数工作流