是否可以创建具有可调整大小映像的正确对齐的UIImageView?
我什么都试过了(例如,两个人的图像,等等),但无法让它发挥作用。
UIImageView的坐标是:
po _Background
(UIImageView *) $1 = 0x14c42bd0
<UIImageView: 0x14c42bd0;
frame = (16 38; 992 672);
opaque = NO;
autoresize = LM+RM+TM+BM;
userInteractionEnabled = NO;
layer = <CALayer: 0x14c42ba0>> - (null)UIImage本身为96x96 (视网膜,即png为192×192,分度为2)。可调整大小的UIImage是使用以下方法创建的:
UIEdgeInsets edgeInsets = UIEdgeInsetsMake(32, 32, 32, 32);
UIImage* resizableImage = [originalImage resizableImageWithCapInsets:edgeInsets];
[_Background setImage:resizableImage];在模拟器中打开“颜色不对齐的图像”时,UIImageView _Background会用黄色高亮显示。删除调试器中的UIImage:
[_Background setImage:nil];删除黄色高亮显示,即没有图像->没有错误对齐。
有人知道这是怎么回事,我怎样才能确保它对齐?
谢谢。
发布于 2013-01-19 15:33:51
根据这个答案:What does yellow tinting represent when using "color misaligned images" on iPhone/iOS,黄色高亮显示图像被拉伸。因为这就是你想要的可调整大小的图像,所以这是有道理的。
https://stackoverflow.com/questions/14415821
复制相似问题