Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android style #22

Open
tiagovdot opened this issue Dec 19, 2015 · 6 comments
Open

Android style #22

tiagovdot opened this issue Dec 19, 2015 · 6 comments

Comments

@tiagovdot
Copy link

The element in Android is not responding to the same style declarations as in iOS. In my case, I cannot seem to find a way to center the text inside of the button in Android.

Any thoughts on this?

@techmentormaria
Copy link

+1 experienced the same.

I wrapped a few around the button to set the paddings and then used justifyContent on the button.

@andrewljohnson
Copy link
Contributor

@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
Copy link

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

@xyz1hang
Copy link

xyz1hang commented Oct 17, 2016

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
Copy link

t2 commented Jan 30, 2017

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

@jacks205
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants