Skip to content

Commit 261f41c

Browse files
committed
blank click~
擦擦擦擦擦
1 parent f03f6f8 commit 261f41c

File tree

3 files changed

+27
-24
lines changed

3 files changed

+27
-24
lines changed

Coding_iOS/Controllers/RootControllers/Project_RootViewController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ - (void)viewDidLoad
142142
}
143143
};
144144

145+
_myFliterMenu.closeBlock=^(){
146+
[weakSelf closeFliter];
147+
};
148+
145149
//初始化弹出菜单
146150
NSArray *menuItems = @[
147151
[MenuItem itemWithTitle:@"项目" iconName:@"pop_Project" index:0],

Coding_iOS/Views/PopFliterMenu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
@interface PopFliterMenu : UIView
1212
@property (assign) BOOL showStatus;
1313
@property (nonatomic , copy) void (^clickBlock)(NSInteger selectNum);
14+
@property (nonatomic , copy) void (^closeBlock)();
1415
@property (nonatomic,assign) NSInteger selectNum; //选中数据
1516
- (instancetype)initWithFrame:(CGRect)frame items:(NSArray *)items;
1617
//将菜单显示到某个视图上

Coding_iOS/Views/PopFliterMenu.m

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,16 @@ - (void)setup {
8484
});
8585
[self addSubview:_tableview];
8686
_tableview.contentInset=UIEdgeInsetsMake(15, 0,0,0);
87-
87+
88+
89+
int contentHeight=320;
90+
if ((kScreen_Height-64)>contentHeight) {
91+
UIView *contentView=[[UIView alloc] initWithFrame:CGRectMake(0,64+contentHeight , kScreen_Width, kScreen_Height-64-contentHeight)];
92+
contentView.backgroundColor=[UIColor clearColor];
93+
[self addSubview:contentView];
94+
UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didClickedContentView:)];
95+
[contentView addGestureRecognizer:tapGestureRecognizer];
96+
}
8897
}
8998

9099
#pragma mark -- event & action
@@ -240,38 +249,27 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
240249
[self dismissMenu];
241250
_clickBlock([self convertToProjectType]);
242251
}else if (indexPath.section==1) {
243-
if(indexPath.row==0) return;
252+
if(indexPath.row==0){
253+
_closeBlock();
254+
return;
255+
}
244256
_selectNum=indexPath.row+kfirstRowNum-1;
245257
[self dismissMenu];
246258
_clickBlock([self convertToProjectType]);
247259
}else
248260
{
249-
if(indexPath.row==0) return;
261+
if(indexPath.row==0){
262+
_closeBlock();
263+
return;
264+
}
250265
_clickBlock(1000);
251266
}
252267
[tableView deselectRowAtIndexPath:indexPath animated:YES];
253268
}
254269

255-
//- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
256-
//{
257-
// if (section!=0) {
258-
// return ({
259-
// UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, 30.5)];
260-
// UIView *seperatorLine=[[UIView alloc] initWithFrame:CGRectMake(20, 15, self.bounds.size.width-40, 0.5)];
261-
// seperatorLine.backgroundColor=[UIColor colorWithHexString:@"0xcccccc"];
262-
// [view addSubview:seperatorLine];
263-
// view;
264-
// });
265-
// }else
266-
// {
267-
// return nil;
268-
// }
269-
//}
270-
//
271-
//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
272-
//{
273-
// return (section!=0)?30.5:0;
274-
//}
275-
//
270+
- (void)didClickedContentView:(UIGestureRecognizer *)sender {
271+
_closeBlock();
272+
}
273+
276274

277275
@end

0 commit comments

Comments
 (0)