import { StyleSheet, Text, View, TouchableOpacity, TouchableHighlight } from
'react-native'
import React from 'react'
const index = () => {
function printData1 () {
alert('This is TouchableOpacity')
}
const printData2 = () => {}
return (
<View style={[Link]}>
<TouchableOpacity style={styles.btn1} onPress={printData1}>
<Text style={styles.btn1Txt}>TouchableOpacity</Text>
</TouchableOpacity>
<TouchableHighlight style={styles.btn2} onPress={printData2}
underlayColor="tomato">
<Text style={styles.btn2Txt}>TouchableHighlight</Text>
</TouchableHighlight>
</View>
)
}
export default index
const styles = [Link]({
container: {
flex:1,
gap:50
},
btn1: {
height:50,
width:'60%',
backgroundColor:'red',
borderRadius:25,
justifyContent:'center',
alignItems:'center',
},
btn1Txt: {
fontSize:20,
fontWeight:'bold',
color:'white'
},
btn2: {
height:50,
width:'60%',
backgroundColor:'blue',
borderRadius:25,
justifyContent:'center',
alignItems:'center'
},
btn2Txt: {
fontSize:20,
fontWeight:'bold',
color:'white'
},
})