整理印象笔记之 关于图片拉伸的方法
UIImageView *imageV = [[UIImageView alloc]init];
[imageV setBackgroundColor:[UIColor redColor]];
[imageV setFrame:CGRectMake(20, 50, 300, 300)];
UIImage *image = [UIImage imageNamed:@"chat_send_nor"];
image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(30, 30, 30, 30)];
[self.view addSubview:imageV];
UIImageView *imageV = [[UIImageView alloc]init];
[imageV setBackgroundColor:[UIColor redColor]];
[imageV setFrame:CGRectMake(20, 50, 300, 300)];
UIImage *image = [UIImage imageNamed:@"chat_send_nor"];
image = [image stretchableImageWithLeftCapWidth:image.size.height*0.5 topCapHeight:image.size.height*0.5];
[self.view addSubview:imageV];
直接在图片管理器里修改
1选中图片
2选择Horizontal and vertical