CGFloat top = 5; // 顶端盖高度
CGFloat bottom = 5 ; // 底端盖高度
CGFloat left = 5; // 左端盖宽度
CGFloat right =5; // 右端盖宽度
UIEdgeInsets insets = UIEdgeInsetsMake(top,left, bottom, right); // 指定为拉伸模式,伸缩后重新赋值
UIImage *img = [UIImage imageNamed:@"imageSmall"];
img=[img resizableImageWithCapInsets:insetsresizingMode:UIImageResizingModeStretch];