UIImage * image = [UIImage imageNamed:@"main_bk"];
// 设置端盖的值
CGFloat top = 10;
CGFloat left = 10;
CGFloat bottom = 10;
CGFloat right = 10;
// 设置端盖的值
UIEdgeInsets edgeInsets = UIEdgeInsetsMake(top, left, bottom, right);
// 设置拉伸的模式
UIImageResizingMode mode = UIImageResizingModeStretch;
// 拉伸图片
UIImage *newImage = [image resizableImageWithCapInsets:edgeInsets resizingMode:mode];
_bgImgView.image = newImage;