搜索
您的当前位置:首页正文

iOS之点击UIbutton不变灰,button的image不变

来源:二三娱乐

要想让uibutton点击不变灰
初始化的时候就不能

        UIButton *button = [[UIButton alloc]init];

初始化的时候酱紫,可以保证button点击时不变灰

        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];

辣么,如果只做了上面的button不会变灰,但是图片还会变灰,下面的可以保证图片不变灰

        buttomButton.adjustsImageWhenHighlighted = NO;

都是一句代码的事

Top