mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 03:50:11 +08:00
Fix Text incorrect line height
Summary:
Setting the line height with the help of Android-provided StaticLayout is incorrect. A
simple example app will display the following when `setLineSpacing(50.f, 0.f)`
is set: {F62987699}. You'll notice that the height of the first line is a few
pixels shorter than the other lines.
So we use a custom LineHeightSpan instead, which needs to be applied to the text
itself, and no height-related attributes need to be set on the TextView itself.
Reviewed By: lexs
Differential Revision: D3751097
fbshipit-source-id: c3574a1080efec26436a5c61afbff89afa8679e7
This commit is contained in:
committed by
Facebook Github Bot
parent
e7521a114f
commit
483953dab3
@@ -129,7 +129,6 @@ public class ReactTextInputShadowNode extends ReactTextShadowNode implements
|
||||
mJsEventCount,
|
||||
mContainsImages,
|
||||
getPadding(),
|
||||
getEffectiveLineHeight(),
|
||||
mTextAlign
|
||||
);
|
||||
uiViewOperationQueue.enqueueUpdateExtraData(getReactTag(), reactTextUpdate);
|
||||
|
||||
Reference in New Issue
Block a user