
如何让UIButton不可用变灰
1个回答
展开全部
Button.alpha = 0.4;
Button.enabled = NO;好了就是这样滴。
setadjustsImageWhenHighlighted = NO;也可以
或者
[saveBtn setBackgroundImage:[self imageWithColor:[UIColor grayColor]] forState:UIControlStateDisabled];
[saveBtn setBackgroundImage:[self imageWithColor:[UIColor colorWithHexString:@"#20BEFD"]] forState:UIControlStateNormal];
//颜色转换 背景图片
- (UIImage *)imageWithColor:(UIColor *)color {
CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, rect);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
Button.enabled = NO;好了就是这样滴。
setadjustsImageWhenHighlighted = NO;也可以
或者
[saveBtn setBackgroundImage:[self imageWithColor:[UIColor grayColor]] forState:UIControlStateDisabled];
[saveBtn setBackgroundImage:[self imageWithColor:[UIColor colorWithHexString:@"#20BEFD"]] forState:UIControlStateNormal];
//颜色转换 背景图片
- (UIImage *)imageWithColor:(UIColor *)color {
CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, rect);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}

2020-07-03 广告
不是的,相反,光泽度数值越大说明物体表面越亮,越有光泽。一般小角度的用在高光泽的测量产品上,大角度的用在低光泽的测量角度上,取决于它们的量程不同。选择什么角度的光泽度仪主要是看你的产品是高光泽产品还是低光泽产品,还是都有。...
点击进入详情页
本回答由杭州彩谱科技有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |