从ios5.0开始,有了一个新的图片拉伸的方法
UIImage *image1 = [UIImage imageNamed:@"txt_on_fe.png"];
UIImage *image = [image1 resizableImageWithCapInsets:UIEdgeInsetsMake(7,7, 7, 7)];
会生成image 可以拉伸的图片
其中
UIEdgeInsetsMake(7,7, 7, 7)(sdk: UIEdgeInsetsMake(CGFloat top, CGFloat left, CGFloat bottom, CGFloat right))
设置了4 个方向,固定好了4 个方向,剩下的中间部分用于复制填充原图片不够的部分