让UIButton点击不变灰

时间:2021-06-24 18:33:25   收藏:0   阅读:0

 

 

 

要想让uibutton点击不变灰
初始化的时候就不能
        UIButton *button = [[UIButton alloc]init];

初始化的时候酱紫,能够保证button点击时不变灰
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];

若是只作了上面的button不会变灰,可是图片还会变灰,下面的能够保证图片不变灰
        buttomButton.adjustsImageWhenHighlighted = NO;

 

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!