【发布时间】:2013-07-27 02:33:59
【问题描述】:
我用所有细节重新更新我的问题,以便更好地理解!
正如他们所说的图片胜于雄辩,我给你做了一个小模型来详细解释一切!
首先,我用文字解释。
我有这个:
- 1 MasterViewController = (RootViewController)
- 1 FirstView = UITableView(将显示许多带有数据的自定义单元格)
- 2 SecondView = 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];
}
【问题讨论】:
-
为什么要继承 UITableView?我认为没有必要。
-
我是新手,我也不太明白你的问题的意思!我倾向于回答我需要创建我的 UITableView,对吗?
-
啊,明白了。你的代码肯定反映了一个新手。它有太多错误,无法在这里有效地解决它。没关系,它伴随着作为一个新手。随着时间的推移和毅力,我相信你会学会的。我建议你通过这个UITableView tutorial。
-
你有什么入门书籍吗?您是编程新手吗?
-
Stack Overflow 的目的恰恰是不为了“新手学习”;人们可以提出并回答有关编程的重点具体的问题,这些问题可以在这里以与未来用户相关的方式得到完整的回答。
标签: ios uitableview