-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Top of Text cut off when lineHeight < fontSize #7687
Comments
Why is this an issue? Surely it's expected behaviour? |
In your link on stackoverflow the UILabel is larger than the text and is vertically aligned in the middle. instructions: {
fontSize: 35,
lineHeight: 35 * 0.75,
paddingTop: 35 - (35 * 0.75), // <-- Add this
}, |
@rogchap you're right! I just applied a background colour and I can see that happening. Thanks! |
I closed this, but actually I'm going to re-open it. It still doesn't seem right that react-native doesn't handle this automatically. I'll let someone on the team close it. Btw, a decent workaround is to create a base text component and then add the padding automatically when when lineHeight < fontSize. |
@kirankalyan5 Do you have any fix? |
@kirankalyan5 @rogchap's solution worked for me like a charm |
Closing this issue because it has been inactive for a while. If you think it should still be opened let us know why. |
Yes, can we please reopen this issue? Special characters like Â, É (yes, capitals) are cut off as well, even when With With As you can see, omitting |
Highly recommend opening a new issue and filling out the template. This issue has been closed for a while. |
Some fonts are not rendered correctly due to a bug(?) in ios (since 7.0!). If you are experiencing the following:
Here's how I fixed it. An excerpt from my upcoming autobiography: "Why Do I Even Code Anymore?".
There's a few blog articles around with more info if you care more about "why". Make sure you use a separate version of the font for Android since it doesn't have this problem. An alternative way to fix would be to change the |
@Jpunt I hadn't noticed any issues with the system fonts on iOS, nor any problems with Android. I'll have another look tho. You likely have a better eye than me. 😆 EDIT: Just read your issue. osnap! I've never it that bad before on Android! |
@Jpunt How did you solve the issue with this exact setting |
We ended up specifying manual values for a |
@Jpunt ah, i see. What a bummer. I will go with |
Yes, this is all very depressing.. |
Version: 0.25.1
OS: Mac 10.11.3
Platform: iOS only since
lineHeight
seems to only be supported for iOSScreenshot:
Code:
https://rnplay.org/apps/GPgsLg
Note: Setting
overflow: "visible"
or a largeheight
doesn't fix this.The text was updated successfully, but these errors were encountered: