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

Incorrect vertical alignment for Ionicons on iOS #566

Closed
jordanmkoncz opened this issue Oct 10, 2017 · 3 comments
Closed

Incorrect vertical alignment for Ionicons on iOS #566

jordanmkoncz opened this issue Oct 10, 2017 · 3 comments

Comments

@jordanmkoncz
Copy link

On iOS, all icons from the Ionicons set have incorrect vertical alignment. The screenshots below show the difference between the vertical alignment of an Ionicons icon versus a MaterialIcons icon in the iOS simulator.

Ionicons:
screen shot 2017-10-10 at 11 53 41 am

MaterialIcons:
screen shot 2017-10-10 at 11 55 55 am

The icons in the screenshots above have the following props:

<Ionicons
  name={name}
  size={32}
  color="#FFFFFF"
  style={{ backgroundColor: 'red' }}
/>

As you can see in the screenshots, the Ionicons icon is not vertically centred, it is positioned too high. The MaterialIcons icon is vertically centred, with the same amount of space above and below the icon. Note that on Android, the Ionicons icons are actually correctly vertically centred, this issue appears to only affect iOS.

@jordanmkoncz
Copy link
Author

jordanmkoncz commented Oct 10, 2017

#301 is for the same problem, but for some reason the person who created the issue immediately closed it, even though this issue still exists (and seems to have existed since 24/09/2016 at the least).

@mjmasn
Copy link

mjmasn commented Feb 12, 2018

@jordanmkoncz if it's still relevant I had this problem with a custom icon font but setting lineHeight to the icon size seems to work (the comment stating it doesn't is from May last year so I guess things have changed in this library or RN):

<MyCustomIcon name="blah" size={40} style={{lineHeight: 40}} />

@johnf
Copy link
Collaborator

johnf commented Aug 3, 2023

Fixed by #1484

@johnf johnf closed this as completed Aug 3, 2023
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

Successfully merging a pull request may close this issue.

3 participants