如果您有一个在 Interface Builder 中创建的按钮,并且已经指向另一个viewController
按钮,您如何在代码中定位该按钮以为其提供代码中正常和选定状态的自定义背景?
UIImage *registerButtonNormal = [[UIImage imageNamed:@"yellowRegisterButton"]resizableImageWithCapInsets:UIEdgeInsetsMake(0, 5, 0, 5)];
[self.registerButton setBackgroundImage:registerButtonNormal forState:UIControlStateNormal];
UIImage *registerButtonSelected = [[UIImage imageNamed:@"yellowRegisterButtonSelected"]resizableImageWithCapInsets:UIEdgeInsetsMake(0, 5, 0, 5)];
[self.registerButton setBackgroundImage:registerButtonSelected forState:UIControlStateSelected];