UIViewContentModeScaleToFill

UIViewContentModeScaleAspectFit

UIViewContentModeScaleAspectFill

UIViewContentModeRedraw

UIViewContentModeCenter

UIViewContentModeTop

UIViewContentModeBottom

UIViewContentModeLeft

UIViewContentModeRight

UIViewContentModeTopLeft

UIViewContentModeTopRight

UIViewContentModeBottomLeft

UIViewContentModeBottomRight

注意以上几个常量,凡是没有带Scale的,当图片尺寸超过 
ImageView尺寸时,只有部分显示在ImageView中。UIViewContentModeScaleToFill属性会导致图片变形。UIViewContentModeScaleAspectFit会保证图片比例不变,而且全部显示在ImageView中,这意味着ImageView会有部分空白。UIViewContentModeScaleAspectFill也会证图片比例不变,但是是填充整个ImageView的,可能只有部分图片显示出来。

UIImageView 的contentMode属性的更多相关文章

  1. [BS-24] UIImageView的contentMode属性

    UIImageView的contentMode属性   所有的UIView都有个contentMode属性,UIImageView继承自UIView,我们在使用UIImageView时,经常要考虑这些 ...

  2. UIImageView 的contentMode属性应用

    UIImageView 的contentMode这个属性是用来设置图片的显示方式,如居中.居右,是否缩放等,有以下几个常量可供设定:UIViewContentModeScaleToFillUIView ...

  3. UIImageView 的contentMode属性 浅析

    UIImageView 的contentMode这个属性是用来设置图片的显示方式,如居中.居右,是否缩放等,有以下几个常量可供设定:UIViewContentModeScaleToFillUIView ...

  4. iOS开发-UIImageView的contentMode属性

    UIImageView 的contentMode这个属性是用来设置图片的显示方式,如居中.居右,是否缩放等,有以下几个常量可供设定:UIViewContentModeScaleToFillUIView ...

  5. UIImageView的contentMode属性

    UIViewContentMode 都有哪些值: typedef NS_ENUM(NSInteger, UIViewContentMode) { UIViewContentModeScaleToFil ...

  6. IOS UIImageView的contentMode属性

    红框表示imageView的frame,下面的图片是原图大小UIViewContentModeScaleToFill,       默认,对图片进行拉伸处理(不是按比例),是充满bouns UIVie ...

  7. 重写UIImageView的image属性

    重写UIImageView的image属性 效果: 当你重写了UIImageView的image属性后你就会对UIImageView怎么显示图片了如指掌了:) 源码: UIImageView.h  + ...

  8. 通过 CALayer 修改 UIImageView 的界面属性

    界面属性的修改是每一个开发者必须知道的,为什么我就记不住呢, shit, 又耽误了时间,为了防止再找不到,特把一些常用的 CALayer属性记在这里,顺便分享 1.设置阴影 1 imageView.l ...

  9. 0119——UIImageView的一些属性 和 简单动画实现

    1.contentMode view.contentMode = UIViewContentModeScaleAspectFill; 2.是否实现触摸 3.简单实现动画 图片的名字为campFire0 ...

随机推荐

  1. js 闭包理解

    闭包主要应用于两种情况: 1 函数作为返回值. 2 函数作为参数传递. 第一种举例: function fn(){ var max = 10; return function bar(){ if(x ...

  2. hibernate关于一对一用法

    首先来说一下数据库的表结构吧.主要涉及到两张表.一张是订单表sub_table 一张是商品表.       之后说entity public class SubTable { private Inte ...

  3. 山东理工大学第七届ACM校赛-经济节约 分类: 比赛 2015-06-26 10:34 19人阅读 评论(0) 收藏

    经济节约 Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 由于经济紧张,某国国王决定减少一部分多余的士兵,这些士兵在边界都有各自的 ...

  4. 2014江西理工大学C语言程序竞赛初级组

    坐公交 解法:略 #include<stdio.h> #include<string> #include<iostream> #include<math.h& ...

  5. MVC api json 格式

    输出json var formatters = config.Formatters.Where(formatter => formatter.SupportedMediaTypes.Where( ...

  6. 关于python的__name__理解

    Python中,每个模块有个__name__属性,当模块是在自己文件下执行的,那么它的__name__属性是__main__,而当它被引入到别的模块中,那么在别的模块下(import模块名 可以引入一 ...

  7. windows下的mysql客户端mysqlworkbench链接虚拟机上CentOS的mysql服务器

    本人在虚拟机上CentOS的Linux环境下安装了mysql服务器,在本地Windows下安装了mysql的客户端mysqlworkbench ,所以就想让windows下的mysql客户端mysql ...

  8. Python3基础 print 中使用+号,连接两个字符串

    镇场诗:---大梦谁觉,水月中建博客.百千磨难,才知世事无常.---今持佛语,技术无量愿学.愿尽所学,铸一良心博客.------------------------------------------ ...

  9. CodeForces 42A Guilty — to the kitchen!

     Guilty — to the kitchen! Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & ...

  10. FZU 2151 OOXX Game

    OOXX Game Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit St ...