iOS 实现安卓.9效果拉伸图片
作者:互联网
实现效果
代码如下:
UIImageView *iv = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Publish_contentView"]];
iv.frame = CGRectMake(10, 100, iv.image.size.width, iv.image.size.height);
UIImage *iamge = [UIImage imageNamed:@"Publish_contentView"]; iamge = [iamge stretchableImageWithLeftCapWidth:0 topCapHeight:10];
UIImageView *iv2 = [[UIImageView alloc] initWithFrame:CGRectMake(200, 100, iamge.size.width, iamge.size.height+100)];
iv2.image = iamge;
[_container addSubview:iv];
[_container addSubview:iv2];
标签:拉伸,iv2,安卓,iOS,UIImageView,iv,image,iamge,size 来源: https://www.cnblogs.com/lovemargin/p/12919763.html