zoukankan      html  css  js  c++  java
  • UIViewContentMode的各种效果

    UIViewContentMode的各种效果:
     
    首先它是枚举类型的数据,表示为下所示:
    typedef enum {

        UIViewContentModeScaleToFill,             // default value
        UIViewContentModeScaleAspectFit,      // contents scaled to fit with fixed aspect. remainder is transparent
        UIViewContentModeScaleAspectFill,     // contents scaled to fill with fixed aspect. some portion of content may be clipped.
        UIViewContentModeRedraw,              // redraw on bounds change (calls -setNeedsDisplay)
        UIViewContentModeCenter,              // contents remain same size. positioned adjusted.
        UIViewContentModeTop,
        UIViewContentModeBottom,
        UIViewContentModeLeft,
        UIViewContentModeRight,
        UIViewContentModeTopLeft,
        UIViewContentModeTopRight,
        UIViewContentModeBottomLeft,
        UIViewContentModeBottomRight,
    } UIViewContentMode; 

     各种展示效果:

    默认值是:0,也就是,UIViewContentModeScaleToFill

    一个个来理解下吧:

    • UIViewContentModeScaleToFill:表示完全填充在 frame 里。
    • UIViewContentModeScaleAspectFit:保持比例,但都在 frame 内。
    • UIViewContentModeScaleAspectFill:保持比例,且必须填满,但 frame 外也有,所以,frame只会把部分图片显示出来。

    其他的是相似的,按照字面意思去理解就OK啦:

    • UIViewContentModeCenter:这个 image 的中心与 frame 的中心重合。
    • UIViewContentModeTop:这个 image 的上边缘与 frame 的上边缘重合。
    • UIViewContentModeBottom:这个 image 的下边缘与 frame 的下边缘重合。
    • UIViewContentModeLeft:这个 image 的左边缘与 frame 的左边缘重合。
    • UIViewContentModeRight:这个 image 的右边缘与 frame 的右边缘重合。
    • UIViewContentModeTopLeft:类似。
    • UIViewContentModeTopRight:类似。
    • UIViewContentModeBottomLeft:类似。
    • UIViewContentModeBottomRight:类似。
  • 相关阅读:
    Linux免密登录
    HDFS shell 常用命令
    zabbix4.4图表中文显示乱码解决办法
    安装zabbix-agent
    安装配置zabbix4.4
    elasticsearch插件sql安装
    dedecms调用头部文件 dede:include时页面出现一行空白的解决方案
    DedeCMS <=5.7 SP2 file_class.php 任意文件上传漏洞
    DedeCMS后台文件任意上传漏洞media_add.php的修改方法
    织梦DEDECMS任意文件上传漏洞与注入漏洞修复方法
  • 原文地址:https://www.cnblogs.com/hello-Huashan/p/4758225.html
Copyright © 2011-2022 走看看