mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-22 11:16:06 +08:00
Add center ImageResizeMode option
Summary:Adds a `center` option to `Image`'s `resizeMode` prop, which doesn't enlarge images.
This is how it looks in UIExplorer:
{F60386921}
Reviewed By: dmmiller
Differential Revision: D3064284
fb-gh-sync-id: 79cd2da8f44c5b3da2e42d3bebf3131335f53c28
shipit-source-id: 79cd2da8f44c5b3da2e42d3bebf3131335f53c28
This commit is contained in:
committed by
Facebook Github Bot 7
parent
05b9902ae6
commit
fb8340d289
@@ -33,6 +33,9 @@ public class ImageResizeMode {
|
||||
if ("stretch".equals(resizeModeValue)) {
|
||||
return ScalingUtils.ScaleType.FIT_XY;
|
||||
}
|
||||
if ("center".equals(resizeModeValue)) {
|
||||
return ScalingUtils.ScaleType.CENTER_INSIDE;
|
||||
}
|
||||
if (resizeModeValue == null) {
|
||||
// Use the default. Never use null.
|
||||
return defaultValue();
|
||||
|
||||
Reference in New Issue
Block a user