我已經覆蓋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