Issue
I am a beginner in React Native and I want I just wrote my first line of code in it. I made a button and started wondering how can I change the colour and other properties of the text in the button.
<Button title="Click Me"></Button>
I was also wondering if there are some good packages that are recommended for beginners. Thanks for the help.
Solution
You can use a Button from react-native like this and can also pass the color prop.
Button
onPress={onPressLearnMore}
title="Click Me"
color="#841584"
/>
For complex and custom buttons you can create it by your own styles using Touchables which are given by react-native you don't have to use any third-party libraries for that.
Example:
<TouchableOpacity style={{ here you can specify custom styles for button container }} onPress={gotoDashboard}>
<Text style={{here you can specify text styles}}>Button Text Here</Text>
// You can add there as many components according to your designs.
</TouchableOpacity>
Answered By - Hamas Hassan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.