File tree Expand file tree Collapse file tree
qmuidemo/Modules/Demos/Components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,9 +95,9 @@ - (void)initSubviews {
9595 // 使用方法 2,以 UIWindow 的形式显示到界面上,这种无需默认隐藏,也无需 add 到某个 UIView 上
9696 self.popupView2 = [[QMUIPopupMenuView alloc ] init ];
9797 self.popupView2 .automaticallyHidesWhenUserTap = YES ;// 点击空白地方消失浮层
98+ self.popupView3 .maskViewBackgroundColor = UIColorMaskWhite;// 使用方法 2 并且打开了 automaticallyHidesWhenUserTap 的情况下,可以修改背景遮罩的颜色
9899 self.popupView2 .maximumWidth = 180 ;
99100 self.popupView2 .shouldShowItemSeparator = YES ;
100- self.popupView2 .maskViewBackgroundColor = UIColorMask;// 用方法 2 可以修改背景遮罩的颜色
101101 self.popupView2 .separatorInset = UIEdgeInsetsMake (0 , self.popupView2 .padding .left , 0 , self.popupView2 .padding .right );
102102 self.popupView2 .items = @[[QMUIPopupMenuItem itemWithImage: UIImageMake (@" icon_tabbar_uikit" ) title: @" QMUIKit" handler: ^{
103103 [weakSelf.popupView2 hideWithAnimated: YES ];
@@ -126,6 +126,15 @@ - (void)initSubviews {
126126 };
127127}
128128
129+ - (void )viewWillDisappear : (BOOL )animated {
130+ [super viewWillDisappear: animated];
131+
132+ // popupView3 使用方法 2 显示,并且没有打开 automaticallyHidesWhenUserTap,则需要手动隐藏
133+ if (self.popupView3 .isShowing ) {
134+ [self .popupView3 hideWithAnimated: animated];
135+ }
136+ }
137+
129138- (void )viewDidLayoutSubviews {
130139 [super viewDidLayoutSubviews ];
131140 CGFloat minY = CGRectGetMaxY (self.navigationController .navigationBar .frame );
You can’t perform that action at this time.
0 commit comments