@@ -84,7 +84,16 @@ - (void)setup {
84
84
});
85
85
[self addSubview: _tableview];
86
86
_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
+ }
88
97
}
89
98
90
99
#pragma mark -- event & action
@@ -240,38 +249,27 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
240
249
[self dismissMenu ];
241
250
_clickBlock ([self convertToProjectType ]);
242
251
}else if (indexPath.section ==1 ) {
243
- if (indexPath.row ==0 ) return ;
252
+ if (indexPath.row ==0 ){
253
+ _closeBlock ();
254
+ return ;
255
+ }
244
256
_selectNum=indexPath.row +kfirstRowNum-1 ;
245
257
[self dismissMenu ];
246
258
_clickBlock ([self convertToProjectType ]);
247
259
}else
248
260
{
249
- if (indexPath.row ==0 ) return ;
261
+ if (indexPath.row ==0 ){
262
+ _closeBlock ();
263
+ return ;
264
+ }
250
265
_clickBlock (1000 );
251
266
}
252
267
[tableView deselectRowAtIndexPath: indexPath animated: YES ];
253
268
}
254
269
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
+
276
274
277
275
@end
0 commit comments