+ 3
How to increase the width of a button in React Native?
I am using flex for styling my buttons. Two buttons horizontally in a row at flex-end. I tried using width: value but it doesn't have any effect on their size. Their width is equal to the placeholder.
5 Antworten
+ 1
Resolved. Had to enclose the button in a view and style in that view.
+ 3
Try using touchableopacity.
I guess buttons have really limited customization of styling I React native.
But using touchableopacity you can create your own design of button, also it has onPress prop supported so it can work like a button.
How to import:
import { Text, TouchableOpacity } from 'react-native';
How to use:
<TouchableOpacity onPress={pressHandler} style={styles.btn}>
<Text>Click me</Text>
</TouchableOpacity>
+ 1
cmcodes let me see your code or component please. I can't figure out without seeing source code.
0
Already tried. No useful. Moreover, it disappears the buttons.