QMUI_iOS icon indicating copy to clipboard operation
QMUI_iOS copied to clipboard

qmui_setTitleAttributes 无效

Open huiyumiao opened this issue 2 years ago • 2 comments

QMUIButton *btn = [[QMUIButton alloc]init]; btn.imagePosition = QMUIButtonImagePositionLeft; btn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 4); [btn setImage:[UIImageMake(imageStr) qmui_imageWithTintColor:JLStyle.mainColor] forState:UIControlStateSelected]; [btn setImage:[UIImageMake(imageStr) qmui_imageWithTintColor:JLStyle.gray99] forState:UIControlStateNormal]; [btn qmui_setTitleAttributes:@{NSFontAttributeName:UIFontBoldMake(16),NSForegroundColorAttributeName:JLStyle.mainColor} forState:UIControlStateSelected]; [btn qmui_setTitleAttributes:@{NSFontAttributeName:UIFontMake(16),NSForegroundColorAttributeName:JLStyle.gray99} forState:UIControlStateNormal]; [btn setTitle:title forState:UIControlStateNormal]; btn.titleLabel.adjustsFontSizeToFitWidth = YES; 在 4.1.3 版本是正常的,升级到最新的 4.6.3 就无效了

huiyumiao avatar Jun 02 '23 02:06 huiyumiao

试试先设置 normal 再设置别的 state 呢?

MoLice avatar Jun 08 '23 21:06 MoLice

试试先设置 normal 再设置别的 state 呢?

还是不行

huiyumiao avatar Jun 09 '23 01:06 huiyumiao