-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Explicitly vertically center iOS text if IOSLineHeight is set #8851
Explicitly vertically center iOS text if IOSLineHeight is set #8851
Conversation
Change baseline formatting for PR Handle unset fontSizes in baseline calculation Put baseline comment on the right line
cc @javache |
Why Adding it as a variant of line height is confusing IMO. And it's not obvious what it does. Not sure about making it default. Though I think this should be default, To add, Android renders text at top by default I think, we need to fix that also. |
Agree with @satya164. LineHeight and alignment are two different things. Conflating them is wrong. |
Yeah I agree, and vertical-align is a good idea. Trying to get platform parity with web and android so I can share more code between the three. Problem is http://www.w3schools.com/cssref/playit.asp?filename=playcss_vertical-align&preval=baseline Might stop pounding this and just maintain my own fork :P |
The default is I think it's useful to have |
@satya164 Gotcha 😄 still playing around with Seems like What web seems to do is vertically center text of the parent when a large https://jsfiddle.net/7ymp3j8b/ ^ If that were run in iOS, the first three examples would be aligned to the bottom. Implementing |
If we're breaking lots of apps by changing the current RN behaviour, may be we just introduce the feature, and keep the current behaviour as default for now. So, may be just add the values possible right now (how about On the web we can apply this to any We shouldn't add an IOS prefix to this, coz we eventually want it on Android too. If we can't get the exact behaviour as on the web since we break lots of apps, I think we should compromise, and keep the current behaviour. |
I was able to set the text vertically middle aligned by setting the the below values to the style of the container view.
|
Pretty sure that only works with a single line :) |
There's a |
68d483e
Summary: …an the font size (per CSS spec) Extending upon work facebook#7603 Closes facebook#8851 ![screen shot 2016-08-04 at 14 49 21](https://cloud.githubusercontent.com/assets/7275322/17404165/bd67bc48-5a52-11e6-9ba1-5a8524f18867.png) ![screen shot 2016-08-04 at 14 49 24](https://cloud.githubusercontent.com/assets/7275322/17404167/be5f4044-5a52-11e6-9014-391349f9c5e1.png) Closes facebook#9211 Differential Revision: D3706347 fbshipit-source-id: 0adfff8e8418b02f9b5d6671f5c89669e41abec3
Summary: …an the font size (per CSS spec) Extending upon work facebook/react-native#7603 Closes facebook/react-native#8851 ![screen shot 2016-08-04 at 14 49 21](https://cloud.githubusercontent.com/assets/7275322/17404165/bd67bc48-5a52-11e6-9ba1-5a8524f18867.png) ![screen shot 2016-08-04 at 14 49 24](https://cloud.githubusercontent.com/assets/7275322/17404167/be5f4044-5a52-11e6-9014-391349f9c5e1.png) Closes facebook/react-native#9211 Differential Revision: D3706347 fbshipit-source-id: 0adfff8e8418b02f9b5d6671f5c89669e41abec3
This is another go at #7603
Made the lineHeight centering explicit by adding a new prop,
IOSLineHeight
, similar to a vendor prefix. Not thrilled about the name, but something likeverticallyCenteredLineHeight
felt off :PTest plan:
Added another entry in the
Text
section of UIExplorer, and updated the screenshots.