| 
TA的每日心情|  | 倒霉 2020-11-28 20:31
 | 
|---|
 签到天数: 18 天 [LV.4]偶尔看看III | 
 
| 这是一个控制拉伸的方法,仅在ios6.0及以上版本使用,示例如下: 复制代码imageView.image = [UIImage imageNamed:@"image.png"]; [imageView setContentStretch:CGRectMake(150.0/300.0,75.0/150.0,10.0/300.0,10.0/150.0)];image.png的大小是 210.0  x  126.0 ;imageView的frame是(9,117,300,150);150.0/300.0表示x轴上,前150个像素不进行拉伸。75.0/150.0表示y轴上,前75个像素不进行拉伸。10.0/300.0表示x轴上150后的10个像素(151-160)进行拉伸,直到image.png铺满imageView。10.0/150.0表示y轴上75后的10个(76-85)像素进行拉伸,直到image.png铺满imageView。
 | 
 |