当前位置: 移动技术网 > 移动技术>移动开发>IOS > IOS开发之图片拉伸不变形实现

IOS开发之图片拉伸不变形实现

2018年09月29日  | 移动技术网移动技术  | 我要评论

ios开发之图片拉伸不变形实现

(uiimage )imagecreatwithcap:(nsstring )imagename { 
uiimage *image = [uiimage imagenamed:imagename]; 
// 设置左边端盖宽度 
nsinteger leftcapwidth = image.size.width * 0.5; 
// 设置上边端盖高度 
nsinteger topcapheight = image.size.height * 0.5;

return [image stretchableimagewithleftcapwidth:leftcapwidth topcapheight:topcapheight]; 
}

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网