ide / react-native-button

A button for React apps
MIT License
773 stars 129 forks source link

Android style #22

Open tiagovdot opened 8 years ago

tiagovdot commented 8 years ago

The

techmentormaria commented 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.

andrewljohnson commented 8 years ago

@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.

jatazoulja commented 8 years ago

Vertical Alignment of the button is at the top, not aligning in the middle...

xyz1hang commented 8 years ago

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

t2 commented 7 years ago

@Phoenix1708 I found a solution to the Android custom fonts issue. Try adding fontWeight: 'normal' to your style declaration.

jacks205 commented 7 years ago

Adding fontWeight: 'normal' worked for the same issue on iOS also. Thanks.