【发布时间】:2015-12-02 10:41:21
【问题描述】:
我已经覆盖了moreNavigationController tableview,但我想使用默认为原生moreNavigationController 的tableview 数据源的同一行(tabbaritem 图标、名称和徽章等)。
我试图从现有数据源中获取单元格。下面是我的代码sn-p:
func tabBarController(tabBarController: UITabBarController, shouldSelectViewController viewController: UIViewController) -> Bool
{
if (viewController == tabBarController.moreNavigationController && tabBarController.moreNavigationController.delegate == nil)
{
if tabBarController.moreNavigationController.topViewController?.view is UITableView
{
let view:UITableView = tabBarController.moreNavigationController.topViewController?.view as! UITableView
tblDataSource = view.dataSource
view.delegate = self
view.dataSource = self
}
}
return true
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell:UITableViewCell = tblDataSource?.tableView(tableView, cellForRowAtIndexPath: indexPath)
return cell
}
但是,它显示了空白单元格。
【问题讨论】:
-
“moreNavigationControlle”是什么意思?
-
moreNavigationController 是第 5 个选项卡 ViewController 如果 UITabviewController 包含五个以上的选项卡。参考developer.apple.com/library/ios/documentation/UIKit/Reference/…
-
您的问题可以与您的问题的其他描述有关。
-
这个问题你解决了吗?
标签: ios iphone xcode swift uitabbarcontroller