Skip to content

Commit

Permalink
this is a workaround for Fam issue facebook#172 where text would be c…
Browse files Browse the repository at this point in the history
…ut off on some TextView's.

It seems that the height reported via Layout and height expected based on lineHeight differ for single line text. This was the best workaround I could come up with after working on it for a day.
  • Loading branch information
keithnorm authored and drtangible committed May 18, 2016
1 parent 55958b6 commit 5571d9a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public void measure(
? Math.min(reactCSSNode.mNumberOfLines, layout.getLineCount())
: layout.getLineCount();
float lineHeight = PixelUtil.toPixelFromSP(reactCSSNode.mLineHeight);
measureOutput.height = lineHeight * lines;
measureOutput.height = layout.getLineCount() == 1 ? layout.getHeight() : lineHeight * lines;
}
}
};
Expand Down

0 comments on commit 5571d9a

Please sign in to comment.