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
Icon.Button has margin right by default #1020
Comments
we can pass use it <Icon.Button |
@sakethaquarterlyai Well yes, you can. But don't you think it should be a part of the component's responsibility to create that spacing only if there's text? Instead of you, the one using the component, checking that yourself and adding/removing the spacing within your code? |
Just adding that this was an issue I experienced as well, specifically with ionicons when used in the header bar. |
Closing as Icon.Button is being removed from the next version of RNVI |
When using
Icon.Button
, the icon hasmarginRight: 10
by default - which means in order for the icon to be in the center of the container, you have to add amargin
orpadding
to the left, or remove the marginRight (by specifyingiconStyle={{marginRight: 0}}
on the Icon.Button).As seen in https://github.com/oblador/react-native-vector-icons/blob/master/lib/icon-button.js#L19
I assume this is because if
Text
is inserted as a child to theIcon.Button
theIcon
needs to be moved left, to create spacing between theIcon
and theText
Is there any built in way to center an
Icon
within anIcon.Button
?Or does this need to be fixed?
The text was updated successfully, but these errors were encountered: