iOS实现带遮罩的弹出选项卡

2020-02-22 09:58:17于丽

上面的NoFree 文件只是一个自定义的Cell,我们可以根据自己的需求自己设计,就不上传了,最后我们说说用法:

LCAlertListView* alertListView = [[LCAlertListView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight) datas:visibleRoleArray count:visibleRoleCountArray];
  alertListView.delegate = self;
  [[[self.view superview] superview] addSubview:alertListView];

下面是代理传值的使用

#pragma mark - LCAlertListViewDelegate
-(void)alertListView:(LCAlertListView *)view didSelectedRow:(NSInteger)row{
 if(didSelectedIndex == 0){
  testVisibleRole = visibleRoleArray[row];
 }else{
   testData = datas[row];
  }
 
 NSIndexPath *indexPath = [NSIndexPath indexPathForRow:didSelectedIndex inSection:0];
 [_myTableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
}

这样,我们的AlertTableVIew 就做好了。

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持易采站长站。