让UIButton点击不变灰

 

 

 

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

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

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

 

posted @ 2021-06-24 14:49  OIMMZC  阅读(338)  评论(0编辑  收藏  举报