Open tiagovdot opened 8 years ago
+1 experienced the same.
I wrapped a few around the button to set the paddings and then used justifyContent
on the button.
@iagomr or @mhollweck Can you give a specific example... do some styles work, others don't? I am putting react-native-button in a cross-platform project too, so I'll debug a little bit.
Vertical Alignment of the button is at the top, not aligning in the middle...
Same issue for me but I managed to center the text by setting justifyContent
to center
as @mhollweck suggested :). However the fontFamily doesn't seems working on Android neither. I used a TypoGraphica font on the button and it worked on iOS but not on Android. I am pretty sure I used the fonts correctly on Android as the fontFamily worked in other places in my app on Android. This is how I used it:
<Button
containerStyle={styles.my_btn}
style={{
fontSize: 20,
fontFamily: 'typographica',
color: 'black'
}}
onPress={this.goToNext.bind(this)}>
Press me !
</Button>
I will be really appreciated If you could have a look.
Thanks
@Phoenix1708 I found a solution to the Android custom fonts issue. Try adding fontWeight: 'normal'
to your style
declaration.
Adding fontWeight: 'normal'
worked for the same issue on iOS also. Thanks.
The
Any thoughts on this?