iOS图片填充方式

2016-07-28  本文已影响242人  yaya_pangdun
NSArray *arr = @[
                      @"UIViewContentModeScaleToFill",      // 拉伸自适应填满整个视图
                      @"UIViewContentModeScaleAspectFit",   // 自适应比例大小显示
                      @"UIViewContentModeScaleAspectFill",  // 原始大小显示
                      @"UIViewContentModeRedraw",           // 尺寸改变时重绘
                      @"UIViewContentModeCenter",           // 中间
                      @"UIViewContentModeTop",              // 顶部
                      @"UIViewContentModeBottom",           // 底部
                      @"UIViewContentModeLeft",             // 中间贴左
                      @"UIViewContentModeRight",            // 中间贴右
                      @"UIViewContentModeTopLeft",          // 贴左上
                      @"UIViewContentModeTopRight",         // 贴右上
                      @"UIViewContentModeBottomLeft",       // 贴左下
                      @"UIViewContentModeBottomRight",      // 贴右下
                     ];

图片完全在view里面显示,并且比例不变 这就是说 如果图片和view的比例不一样 就会有留白

clipsToBounds = YES;
上一篇 下一篇

猜你喜欢

热点阅读