//相当于button使用
<TouchableHighlight
//点击后的背景颜色
underlayColor="#1FB579"
//设置点击事件
onPress={hanwanjie}
style={styleObj.loginButton}>
<Text style={styleObj.loginButtonText}>登录</Text>
</TouchableHighlight>
//登录按钮的点击事件
const hanwanjie = () => {
console.log('点击登录按钮');
}
const styleObj = StyleSheet.create({
//登录按钮样式
loginButton:{
backgroundColor:'#1fd094',
width:screenWidth*0.6,
height:45,
marginTop:30,
alignItems:'center',
borderRadius:8,
},
//登录文字设置
loginButtonText:{
color:'#ffffff',
fontSize:18,
lineHeight:42,
fontWeight:'bold',
},
});