- React Native Cookbook
- Dan Ward
- 84字
- 2025-04-04 14:57:29
How it works...
In this example, we made use of the TouchableOpacity component. This component allows us to define a nice animation that changes the opacity when the user presses the button.
We can use the activeOpacity property to set the opacity value when the button gets pressed. The value can be any number between 0 and 1, where 0 is completely transparent.
If we press the rounded button, we will see a native Alert message, as shown in the following screenshot:
