当前位置:编程学习 > wap >>

图片边角不变、中间拉伸的效果怎么实现??

图片边角不变、中间拉伸的效果怎么实现?? 图片边角 --------------------编程问答-------------------- 用到2种方法:
1、(UIImage *)stretchableImageWithLeftCapWidth: (NSInterger) topCapHeight: (NSinterger)
这种方法只适用于ios5以下的版本。它只无限拉伸离最左边像素(第一个参数值) +1和离最上边的像素的值+1(第二个参数值)。
2、(UIImage *)resizableImageWithCapInsets: (UIEdgeInsets)
//方法介绍
- (UIImage *)resizableImageWithCapInsets: (UIEdgeInsets)capInsets NS_AVAILABLE_IOS(5_0); // create a resizable version of this image. the interior is tiled when drawn.
- (UIImage *)resizableImageWithCapInsets: (UIEdgeInsets)capInsets resizingMode: (UIImageResizingMode)resizingMode NS_AVAILABLE_IOS(6_0); // the interior is resized according to the resizingMode

我也是摘抄的,具体来源这http://www.fenglepai.com/如何实现图片边角不变、中间拉伸的效果?-1

希望对你有用
补充:移动开发 ,  移动开发其他问题
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,