我在创建UIScrollView
UITableView
scrollViewForBP = [[UIScrollView alloc]initWithFrame:CGRectMake(0,225,balanceView.frame.size.width,balanceView.frame.size.height/2 - 30)];
scrollViewForBP.pagingEnabled = YES;
scrollViewForBP.contentSize =
CGSizeMake(CGRectGetWidth(scrollViewForBP.frame) * 3,scrollViewForBP.frame.size.height);
scrollViewForBP.showsHorizontalScrollIndicator = NO;
scrollViewForBP.showsVerticalScrollIndicator = NO;
scrollViewForBP.directionalLockEnabled =YES;
scrollViewForBP.scrollsToTop = NO;
scrollViewForBP.delegate = self;
[balanceView addSubview:scrollViewForBP];
for (int i = 0; i < 15; i++)
{
CGFloat xOrigin = i * scrollViewForBP.frame.size.width+10;
Last5TransTblView = [[UITableView alloc] initWithFrame:CGRectMake(xOrigin,2,balanceView.frame.size.width-20,balanceView.frame.size.height/2 - 30) style:UITableViewStylePlain];
Last5TransTblView.tag= i;
[Last5TransTblView setDelegate:self];
[Last5TransTblView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
[Last5TransTblView setDataSource:self];
[Last5TransTblView setBackgroundColor:[UIColor clearColor]];
Last5TransTblView.scrollEnabled = NO;
Last5TransTblView.pagingEnabled = YES;
[scrollViewForBP addSubview:Last5TransTblView];
}
现在我需要隐藏特定的tab tableView。任何人请帮助我。
答案 0 :(得分:0)
您可以使用
创建任何子视图[ParentView viewWithTag:15]
在您的情况下,您只需要使用
[scrollViewForBP viewWithTag:desiredTag]
如果您想要这样,也可以输入案例
UITableView *myTableView = (UITableView *)[scrollViewForBP viewWithTag:desiredTag];
获得tableView后,可以使用 .hidden 隐藏它,即
myTableView.hidden = YES