有谁知道如何在不使用的情况下做到这一点[UIImage resizableImageWithCapInsets:]
?我正在尝试为无法运行 iOS5 的用户提供兼容性。
UIEdgeInsets imgInsets = UIEdgeInsetsMake(10.f, 5.f, 13.f, 44.f);
UIImage *image = [[UIImage imageNamed:@"fileName"] resizableImageWithCapInsets:imgInsets]; // only available in iOS5+
请注意,我不想创建 1px 可拉伸图像,我想在调整 UIImage 大小时平铺在插图之间定义的区域。也就是说,[UIImage stretchableImageWithLeftCapWidth: topCapHeight:]
不成功。
非常感谢!