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个像素这一块区域将会被拉伸。剩余的部分也不会被拉伸。

  • 相关阅读:
    User-Introduction——介绍
    UserHow to Config
    DevHacking
    【转载】常备JS操作
    【转载】本地搜索服务全面评测
    User-Data config
    小知识:常用到的软件或服务及其使用的端口
    网页配色方案
    User-Validation User Guide
    Dev-Introduction
  • 原文地址:https://www.cnblogs.com/fuhaots2009/p/3435970.html
Copyright © 2011-2022 走看看