|
@@ -32,23 +32,12 @@
|
|
|
|
|
|
- (void)changeStyle:(NSString*)title titleColor:(UIColor*)titleColor backgroundColor:(UIColor*)backgroundColor {
|
|
|
[self setUserInteractionEnabled:false];
|
|
|
- //背景
|
|
|
+ [self setAttributedTitle:[[NSAttributedString alloc] initWithString:title attributes:@{
|
|
|
+ NSForegroundColorAttributeName:titleColor,
|
|
|
+ NSFontAttributeName:[UIFont systemFontOfSize:10 weight:500],
|
|
|
+ }] forState:UIControlStateNormal];
|
|
|
+ [self setContentEdgeInsets:UIEdgeInsetsMake(2, 5, 2, 5)];
|
|
|
[self setBackgroundColor:backgroundColor];
|
|
|
-
|
|
|
- if (@available(iOS 15.0, *)) {
|
|
|
- //文字,大小
|
|
|
- UIButtonConfiguration* config = [UIButtonConfiguration plainButtonConfiguration];
|
|
|
- [config setContentInsets:NSDirectionalEdgeInsetsMake(2, 5, 2, 5)];
|
|
|
- config.attributedTitle = [[NSAttributedString alloc] initWithString:title attributes:@{
|
|
|
- NSForegroundColorAttributeName:titleColor,
|
|
|
- NSFontAttributeName:[UIFont systemFontOfSize:10 weight:500],
|
|
|
- }];
|
|
|
- [self setConfiguration:config];
|
|
|
- } else {
|
|
|
- self.titleLabel.font = [UIFont systemFontOfSize:10.0 weight:500];
|
|
|
- [self.titleLabel setTextColor:titleColor];
|
|
|
- self.contentEdgeInsets = UIEdgeInsetsMake(2, 5, 2, 5);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- (NSString*)getRiskTitle:(NSInteger)type {
|