Vertically center iOS text if lineHeight is set#7603
Vertically center iOS text if lineHeight is set#7603tuckerconnelly wants to merge 5 commits intofacebook:masterfrom
Conversation
|
By analyzing the blame information on this pull request, we identified @nicklockwood and @Kudo to be potential reviewers. |
|
this is really helpful! please approve this pr |
|
@tuckerconnelly Can you provide some screenshots from UIExplorer before and after? This might change how existing apps look so it is likely a breaking change though. @nicklockwood, @javache What do you think? |
Libraries/Text/RCTShadowText.m
Outdated
| // vertically center text | ||
| CGFloat fontSize = round(_fontSize * (_allowFontScaling && self.fontSizeMultiplier > 0.0 ? self.fontSizeMultiplier : 1.0)); | ||
| [attributedString addAttribute:NSBaselineOffsetAttributeName | ||
| value:[NSNumber numberWithFloat:lineHeight/2 - fontSize/2] |
There was a problem hiding this comment.
Nit: can you replace
[NSNumber numberWithFloat:lineHeight/2 - fontSize/2]
With
@(lineHeight/2 - fontSize/2)
|
@mkonicek I agree that this should be the default behaviour. Difficult to guess what the impact might be on existing apps though. |
|
@tuckerconnelly updated the pull request. |
|
@tuckerconnelly updated the pull request. |
|
any update? i'm looking forward this pr to be merged |
|
@facebook-github-bot shipit |
|
Thanks for importing. If you are an FB employee go to Phabricator to review. |
|
Shame for shipping this without looking at Travis build status https://travis-ci.org/facebook/react-native/jobs/133786669 This PR broke trunk |
|
After talking to the teams internally, looks like we can't accept this change, have to revert it. |
|
Feel free to do another iteration and submit a new PR |
|
That's the nature of a breaking change lol What would you want in another iteration? |


First PR!!
This fixes #2991 :)