我用所有细节重新完全更新我的问题,以获得更多理解!
正如他们所说的图片胜于雄辩,我给你做了一个小模型来详细解释一切!
首先,我用文字解释。
我有这个 :
- 1 MasterViewController = (RootViewController)
- 1 FirstView = UITableView(将显示许多带有数据的自定义单元格)
- 2 第二视图 = UIView
- 3 第三视图 = UIView
现在图像/模型:
在我的 MasterViewController.h 中(代码的一部分)
@property (strong, nonatomic) FirstView *firstView;
@property (strong, nonatomic) SecondView *secondView;
@property (strong, nonatomic) ThirdView *thirdView;
在我的 MasterViewController.m 中(代码的一部分)
firstView = [[LastSalesView alloc] initWithFrame:CGRectMake(0.0, 0.0, result.width, result.height)];
firstView.backgroundColor = [UIColor clearColor];
firstView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[bottomContainerView addSubview:firstView];
[firstView setHidden:NO];
secondView = [[LastSalesView alloc] initWithFrame:CGRectMake(0.0, 0.0, result.width, result.height)];
secondView.backgroundColor = [UIColor clearColor];
secondView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[bottomContainerView addSubview:secondView];
[secondView setHidden:NO];
thirdView = [[LastSalesView alloc] initWithFrame:CGRectMake(0.0, 0.0, result.width, result.height)];
thirdView.backgroundColor = [UIColor clearColor];
thirdView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[bottomContainerView addSubview:thirdView];
[thirdView setHidden:NO];
-(void)viewFirstPage:(id)sender {
NSLog(@"button first pushed");
[firstView setHidden:NO];
[secondView setHidden:YES];
[thirdView setHidden:YES];
}
-(void)viewSecondPage:(id)sender {
NSLog(@"button second pushed");
[firstView setHidden:YES];
[secondView setHidden:NO];
[thirdView setHidden:YES];
}
-(void)viewThirdPage:(id)sender {
NSLog(@"button third pushed");
[firstView setHidden:YES];
[secondView setHidden:YES];
[thirdView setHidden:NO];
}