mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-08 09:37:21 +08:00
<Text> Expose Android's includeFontPadding property to JavaScript.
Summary: By default Android will put extra space above text to allow for upper-case accents or other ascenders. With some fonts, this can make text look slightly misaligned when centered vertically. We have found that the effect is very noticeable with certain custom fonts on Android. On iOS the font aligns vertically as expected. Android exposes a property `includeFontPadding` that will remove this extra padding if set to false. This PR exposes that to JS, and adds it to the documentation and UIExplorer. Closes https://github.com/facebook/react-native/pull/9323 Differential Revision: D4266713 Pulled By: lacker fbshipit-source-id: f9711254bc26c09b4586a865f0e95ef4bf77cf3f
This commit is contained in:
committed by
Facebook Github Bot
parent
9c5efa34fb
commit
833961e05d
@@ -143,6 +143,11 @@ public class ReactTextViewManager extends BaseViewManager<ReactTextView, ReactTe
|
||||
view.setBorderColor(SPACING_TYPES[index], rgbComponent, alphaComponent);
|
||||
}
|
||||
|
||||
@ReactProp(name = "includeFontPadding", defaultBoolean = true)
|
||||
public void setIncludeFontPadding(ReactTextView view, boolean includepad) {
|
||||
view.setIncludeFontPadding(includepad);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExtraData(ReactTextView view, Object extraData) {
|
||||
ReactTextUpdate update = (ReactTextUpdate) extraData;
|
||||
|
||||
Reference in New Issue
Block a user