pro*_*stm 6 uitabbarcontroller uinavigationcontroller ios
我已经获得了具有以下工作流程的设计:
基于此描述,在我看来应用程序需要导航控制器根视图控制器用于登录和tableview,然后在点击表格行时,应用程序需要利用tabbar控制器来深入挖掘数据.
我似乎无法使用故事板将UITabBarController添加到导航控制器.此外,我发现其他SO帖子提出类似的问题,但提供的答案似乎都不是最新的,或使用当前(iOS7/8)最佳实践解决此工作流程.有没有办法完成这个工作流程?如果没有,是否有一个简明的解释我可以用来告知设计师和利益相关者?
我检查了您的要求。
尽管Apple Inc.不建议在常规使用情况下使用,
但是,可以通过以下步骤轻松地实现建议的设计原则,从而轻松实现这一目标。

Run Code Online (Sandbox Code Playgroud)(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"test" forIndexPath:indexPath]; cell.textLabel.text = [NSString stringWithFormat:@"%ld", (long)[indexPath row]]; return cell; }
(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITabBarController *tbc = [self.storyboard instantiateViewControllerWithIdentifier:@"MainTabbedViewController"];
tbc.selectedIndex= (long)[indexPath row];
[self showViewController:tbc sender:self];
}
Run Code Online (Sandbox Code Playgroud)
https://24hrstech.wordpress.com/2012/08/19/create-tabbarcontroller-programmatically/
| 归档时间: |
|
| 查看次数: |
16273 次 |
| 最近记录: |