Tencent / QMUI_iOS

QMUI iOS——致力于提高项目 UI 开发效率的解决方案
http://qmuiteam.com/ios
Other
7.07k stars 1.37k forks source link

QMUIPopupMenuView 更新到最新版本后在itemConfigurationHandler 设置按钮颜色出现异常 #1294

Closed shuyouhui666 closed 2 years ago

shuyouhui666 commented 2 years ago

351631070307_ pic

self.popupByWindow = [[QMUIPopupMenuView alloc] init]; self.popupByWindow.automaticallyHidesWhenUserTap = YES;// 点击空白地方消失浮层 // self.popupByWindow.tintColor = UIColor.qd_tintColor; self.popupByWindow.maskViewBackgroundColor = [UIColor.grayColor colorWithAlphaComponent:.05];// 使用方法 2 并且打开了 automaticallyHidesWhenUserTap 的情况下,可以修改背景遮罩的颜色 self.popupByWindow.shouldShowItemSeparator = YES; self.popupByWindow.itemHeight = 44; self.popupByWindow.itemConfigurationHandler = ^(QMUIPopupMenuView _Nonnull aMenuView, __kindof QMUIPopupMenuBaseItem _Nonnull aItem, NSInteger section, NSInteger index) { //aItem.menuView.itemTitleColor = UIColor.redColor; aMenuView.itemTitleColor = UIColor.redColor; }; @WeakObj(self) self.popupByWindow.items = @[[QMUIPopupMenuButtonItem itemWithImage:nil title:@"大陆" handler:^(QMUIPopupMenuButtonItem _Nonnull aItem) { @StrongObj(self) self.phonelable.text = @"大陆"; self.areaCodeText.text = @"86"; [self.popupByWindow hideWithAnimated:YES]; }], [QMUIPopupMenuButtonItem itemWithImage:nil title:@"港澳台" handler:^(QMUIPopupMenuButtonItem _Nonnull aItem) { @StrongObj(self) self.phonelable.text = @"港澳台"; self.areaCodeText.text = @""; [self.areaCodeText resignFirstResponder]; [self.popupByWindow hideWithAnimated:YES]; }], [QMUIPopupMenuButtonItem itemWithImage:nil title:@"海外" handler:^(QMUIPopupMenuButtonItem * _Nonnull aItem) { @StrongObj(self) self.phonelable.text = @"海外"; self.areaCodeText.text = @""; [self.areaCodeText resignFirstResponder]; [self.popupByWindow hideWithAnimated:YES]; }]]; self.popupByWindow.sourceView = self.phonelable; [self.popupByWindow showWithAnimated:YES];

shuyouhui666 commented 2 years ago
self.popupByWindow.itemTitleColor = UIColor.redColor;

颜色是初始化设置的 哈哈哈哈