【发布时间】:2011-12-26 13:05:26
【问题描述】:
- 我在我的项目中使用拆分视图控制器,
- 在拆分视图中,我有 RootViewCotroller(左), 详细信息ViewConroller(右)。
- 在根视图控制器中,我有 3 行。
- 现在我想在细节视图中显示不同类型的外观,当 在 rootview 中选择不同的行。
- ...
- 在详细信息视图中:
- 1.选择row1时显示tableView。
- 2.选择行2时显示文本字段。
- 3.从rootviewcontroller中选择row3时的图像视图。
- ..
- 我在 RootViecontroller 中编写了这样的代码,但在 详情查看。 -
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
RightViewController *rightViewController = [[RightViewController alloc] initWithNibName:@"RightViewController"bundle:nil];
//[self.navigationController pushViewController:rightViewController animated:YES];
if(indexPath.row == 0)
{
UILabel *infoLabel = [[UILabel alloc]initWithFrame:CGRectMake(5, 5, 450, 150)];
infoLabel.text = @"Customer:Barrick \r\n Mine:gold \r\n Location:USA";
[rightViewController.view addSubview:infoLabel];
UITableView *mapTable = [[UITableView alloc]initWithFrame:CGRectMake(165, 5, 450,150)style:UITableViewStyleGrouped];
[rightViewController.view addSubview:mapTable];
}
if(indexPath.row == 1)
{
UILabel *infoLabel = [[UILabel alloc]initWithFrame:CGRectMake(5, 5, 450, 150)];
infoLabel.text = @"Eqipement";
[rightViewController.view addSubview:infoLabel];
}
if(indexPath.row == 2)
{
image view..
}
[rightViewController release];
}
- 怎么办..?提前致谢。
【问题讨论】:
标签: iphone uitableview uisplitviewcontroller ipad