-
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
[Style][iOS]The style lineHeight behaves not exactly same as CSS #2991
Comments
In addition, the text height measured in RCTMeasure is also not exactly same as H5, about 1.5px smaller than H5's text height |
What is "H5"? Do you mean an |
@ide H5 = HTML5 = Web, I used same CSS style in Web, but it behaves differently. |
OK. The centering behavior should probably be the same but I'm not sure about the text height. There are some things that iOS and Android and browsers all do differently and font rendering is one of them. |
I wrote a demo in https://rnplay.org/apps/mJMANg. |
Does this issue have a good solution? |
Same problem here. I set lineHeight to 40, but the real line height is 40.975. |
Sure, I found this problem when I use line-height attribute ,hope that the text is is vertical align in the box, |
Summary: First PR!! This fixes facebook#2991 :) Closes facebook#7603 Differential Revision: D3417257 fbshipit-source-id: 074d56c1dfc0a9ba713e59c804286fd915589eeb
Summary: First PR!! This fixes facebook#2991 :) Closes facebook#7603 Differential Revision: D3417257 Pulled By: bestander fbshipit-source-id: fca990a973edaf7bae5481d03f5da5de0c085c16
Summary: First PR!! This fixes facebook#2991 :) Closes facebook#7603 Differential Revision: D3417257 fbshipit-source-id: 074d56c1dfc0a9ba713e59c804286fd915589eeb
Summary: First PR!! This fixes facebook#2991 :) Closes facebook#7603 Differential Revision: D3417257 Pulled By: bestander fbshipit-source-id: fca990a973edaf7bae5481d03f5da5de0c085c16
I write a Text component whose style is:
It appears like this in iOS device :
But in Web, it is supposed to be like :
The text should be vertically centered.
Is there any way to fix this ? Some FE is used to use
lineHeight=height
to make the text vertically centered.The text was updated successfully, but these errors were encountered: