diff --git a/doric-android/doric/src/main/java/pub/doric/shader/ImageNode.java b/doric-android/doric/src/main/java/pub/doric/shader/ImageNode.java index 7385b2d2..b414cb7a 100644 --- a/doric-android/doric/src/main/java/pub/doric/shader/ImageNode.java +++ b/doric-android/doric/src/main/java/pub/doric/shader/ImageNode.java @@ -68,6 +68,19 @@ public class ImageNode extends ViewNode { super(doricContext); } + @Override + protected void blendLayoutConfig(JSObject jsObject) { + super.blendLayoutConfig(jsObject); + JSValue maxWidth = jsObject.getProperty("maxWidth"); + if (maxWidth.isNumber()) { + mView.setMaxWidth(DoricUtils.dp2px(maxWidth.asNumber().toFloat())); + } + JSValue maxHeight = jsObject.getProperty("maxHeight"); + if (maxHeight.isNumber()) { + mView.setMaxHeight(DoricUtils.dp2px(maxWidth.asNumber().toFloat())); + } + } + @Override protected ImageView build() { ImageView imageView = new ImageView(getContext());