拖线拿到按钮,只设置一次就好,awakeFromNib,点属性currentBackgroundImage,获取到当前的背景图片,处理拉伸,重新给button设置处理后的拉伸图片
-(void)awakeFromNib
{
[super awakeFromNib];
UIImage *image = _loginRegisterButton.currentBackgroundImage;
image = [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];
[_loginRegisterButton setBackgroundImage:image forState:UIControlStateNormal];
}