feat:align android and iOS image's default scale type

This commit is contained in:
pengfei.zhou 2020-03-24 11:19:22 +08:00 committed by osborn
parent 0cfbef67a2
commit 4ea6da2d0a
2 changed files with 4 additions and 1 deletions

View File

@ -66,7 +66,9 @@ public class ImageNode extends ViewNode<ImageView> {
@Override @Override
protected ImageView build() { protected ImageView build() {
return new ImageView(getContext()); ImageView imageView = new ImageView(getContext());
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
return imageView;
} }
@Override @Override

View File

@ -39,6 +39,7 @@ @implementation DoricImageNode
- (UIImageView *)build { - (UIImageView *)build {
return [[YYAnimatedImageView new] also:^(UIImageView *it) { return [[YYAnimatedImageView new] also:^(UIImageView *it) {
it.clipsToBounds = YES; it.clipsToBounds = YES;
it.contentMode = UIViewContentModeScaleAspectFill;
}]; }];
} }