我希望按钮看起来像是某种方式,而不是将按钮子类化,而是这样编写的
[[UIButton appearanceWhenContainedIn:[EABaseViewController class], nil]setBackgroundImage:[UIImage imageNamed:@"gradient_border"] forState:UIControlStateNormal];
[[UIButton appearanceWhenContainedIn:[EABaseViewController class], nil]setBackgroundImage:[UIImage imageNamed:@"gradient_border_grey"] forState:UIControlStateHighlighted];
[[UIButton appearanceWhenContainedIn:[EABaseViewController class], nil]setBackgroundImage:[UIImage imageNamed:@"gradient_border_grey"] forState:UIControlStateSelected];
[[UIButton appearanceWhenContainedIn:[EABaseViewController class], nil]setBackgroundImage:[UIImage imageNamed:@"gradient_border_grey"] forState:UIControlStateSelected|UIControlStateHighlighted];
[[UIButton appearanceWhenContainedIn:[EABaseViewController class], nil]setBackgroundImage:[UIImage imageNamed:@"grey_border_grey"] forState:UIControlStateDisabled];
问题是,当我单击按钮时,而不是更改为图像gradient_border_grey,而是更改了其alpha。我找不到解决方法?
我如何解决它 ?
最佳答案
我需要将按钮类型设置为自定义以解决此问题
关于ios - 按钮外观点击版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26201994/