@@ -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