Center a image and a text in a button in react native

时间:2017-08-30 20:17:33

标签: css reactjs react-native jsx

I'd like to have a button with an image and a text centered. The button is placed in the bottom of the screen.

I have this code :

<a href="https://link-to-whatever.com/winner"> <!-- If diced == 6 -->

this works very well of iOS, however, the image is really small on Android, like so : https://i.stack.imgur.com/jFWAy.png

Do you know anything about this behaviour ? Do you know if there's another solution to have the image and the text centered in the button like so : https://i.stack.imgur.com/geBSz.png

Thanks !

1 个答案:

答案 0 :(得分:0)

What are the styles you have set on your image? Also you shouldn't have to nest image inside of text. I'd pull that out and put it before text.