美文网首页
UIImageView Tips

UIImageView Tips

作者: CoderLGL | 来源:发表于2018-11-23 11:04 被阅读0次

UIImageView 的contentMode属性,各类型效果

typedef NS_ENUM(NSInteger, UIViewContentMode) {

     但凡在设置图片模式的枚举中包含Scale这个单词的值, 都会对原有的图片进行缩放

     UIViewContentModeScaleToFill,
     按照"UIImageView"的宽高比缩放图片至图片填充整个UIImageView;

     UIViewContentModeScaleAspectFit,
     按照"图片的宽高"比例缩放图片至图片的宽度或者高度和UIImageView一样, 并且让整个图片都在UIImageView中. 然后居中显示

     UIViewContentModeScaleAspectFill,
     按照"图片的宽高"比例缩放图片至图片的宽度和高度填充整个UIImageView. 然后居中显示

     UIViewContentModeRedraw,
     UIViewContentModeCenter,
     UIViewContentModeTop,
     UIViewContentModeBottom,
     UIViewContentModeLeft,
     UIViewContentModeRight,
     UIViewContentModeTopLeft,
     UIViewContentModeTopRight,
     UIViewContentModeBottomLeft,
     UIViewContentModeBottomRight,
     };
contentMode

更详细的看这里:https://blog.csdn.net/yuanpeng1014/article/details/70888584

相关文章

网友评论

      本文标题:UIImageView Tips

      本文链接:https://www.haomeiwen.com/subject/gaadqqtx.html