我已经覆盖moreNavigationController
tableview,但我想使用默认为本机moreNavigationController
的tableview数据源(tabbaritem图标,名称和徽章等)相同的行。 我试图从现有的数据源中获取单元格。以下是我的代码片段:自定义moreNavigationController的tableview和类似的用户界面
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”是什么意思? –
如果UITabviewController包含多于五个选项卡,则moreNavigationController是第五个选项卡ViewController。请参阅https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITabBarController_Class/#//apple_ref/occ/instp/UITabBarController/moreNavigationController –
您的问题可以通过对问题的额外描述来完成。 – andrewbuilder