UIImageView 图片填充,按比例,平铺

来源:互联网 发布:mac ndk 下载 编辑:程序博客网 时间:2024/05/12 21:56

设置  UIImageView 的contentMode属性,根据自己的需要选择下面


 UIViewContentModeScaleToFill,

    UIViewContentModeScaleAspectFit,      // 原比例,不变形,

    UIViewContentModeScaleAspectFill,     // 等比例填充

    UIViewContentModeRedraw,              // redraw on bounds change (calls -setNeedsDisplay)

    UIViewContentModeCenter,              // contents remain same size. positioned adjusted.

    UIViewContentModeTop,

    UIViewContentModeBottom,

    UIViewContentModeLeft,

    UIViewContentModeRight,

    UIViewContentModeTopLeft,

    UIViewContentModeTopRight,

    UIViewContentModeBottomLeft,

    UIViewContentModeBottomRight,


0 0
原创粉丝点击