zoukankan      html  css  js  c++  java
  • IOS开发UIImage中stretchableImageWithLeftCapWidth方法的解释

    - (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapWidth;

     

    Creates and returns a new image object with the specified cap values.


    During scaling or resizing of the image, areas covered by a cap are not scaled or resized. Instead, the 1-pixel wide area not covered by the cap in each direction is what is scaled or resized. This technique is often used to create variable-width buttons, which retain the same rounded corners but whose center region grows or shrinks as needed.

    上面是官方文档上得解释。意思就是用来创建一个内容可拉伸,而边角不拉伸的图片,需要两个参数,第一个是左边不拉伸区域的宽度,第二个参数是上面不拉伸的高度。那么接下来的一个像素会被拉伸。例如,leftCapHeight为6, topCapHeight为8。那么,图片左边的6个像素,上边的8个像素。不会被拉伸,而左边的第7个像素,上边的第9个像素这一块区域将会被拉伸。剩余的部分也不会被拉伸。

  • 相关阅读:
    Python的可变和不可变类型
    Pycharm设置语法规范快捷键方式
    python学习0305作业
    关于jQuery对象与DOM对象
    ie6下子元素撑大父元素
    Hibernate持久层ORM框架
    基于注解的事务管理
    掌握基于AOP事务管理
    Spring事务管理
    事务保存点savepoint
  • 原文地址:https://www.cnblogs.com/fuhaots2009/p/3435970.html
Copyright © 2011-2022 走看看