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 cccd57e6..94c07436 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 @@ -66,7 +66,9 @@ public class ImageNode extends ViewNode { @Override protected ImageView build() { - return new ImageView(getContext()); + ImageView imageView = new ImageView(getContext()); + imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); + return imageView; } @Override diff --git a/doric-iOS/Pod/Classes/Shader/DoricImageNode.m b/doric-iOS/Pod/Classes/Shader/DoricImageNode.m index eb94ccc4..d939077d 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricImageNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricImageNode.m @@ -39,6 +39,7 @@ @implementation DoricImageNode - (UIImageView *)build { return [[YYAnimatedImageView new] also:^(UIImageView *it) { it.clipsToBounds = YES; + it.contentMode = UIViewContentModeScaleAspectFill; }]; }