0
我试图建立一个登录页面,使用此代码:阵营本地TouchableHighlight不工作
<View style={styles.formContainer}>
<TouchableHighlight onPress={this.props.authentication}>
<Icon.Button name="facebook" style={styles.loginIconButton}>
<Text style={styles.loginButtonText}>Login with Facebook</Text>
</Icon.Button>
</TouchableHighlight>
</View>
运行此它给“
可触摸的孩子必须是本地或转发setNativeProps到本地组件”时
,所以我包图标在视图中,作为建议的其他职位:
<TouchableHighlight onPress={this.props.authentication.bind(this)}>
<View>
<Icon.Button name="facebook" style={styles.loginIconButton}>
<Text style={styles.loginButtonText}>Login with Facebook</Text>
</Icon.Button>
</View>
</TouchableHighlight>
现在在新闻发布会不会被触发了。但是,如果我删除Icon.Button
标签,并保持文本,它工作正常。我该如何解决这个布局?
是的,它的功能就像一个魅力 - 应该先看看源头:) –