current position:Home>Reactnative foundation - 06 (buttons: button, touchableopacity)

Reactnative foundation - 06 (buttons: button, touchableopacity)

2022-01-27 03:26:31 The black cat made a strange mistake

1、 System button <Button> </Button>

2、 Custom buttons <TouchableOpacity> </TouchableOpacity>

        Internal text , Written in <Text> in

        activeOpacity: Click to activate the transparency

        onPress: Click event

<Button  title=" Button " onPress={() => alert(' It's time for me , pain o(╥﹏╥)o')}></Button>

<TouchableOpacity   style={
   {backgroundColor: 'pink', }}   activeOpacity={0.8}
   onPress={() => alert(' Custom buttons , It hurts me a little ')} 
   <Text style={
   {color: 'red', letterSpacing: 10}}>  Sign in  </Text>

copyright notice
author[The black cat made a strange mistake],Please bring the original link to reprint, thank you.

Random recommended