【问题标题】:Unable to click on more option list in tab bar controller [closed]无法单击选项卡栏控制器中的更多选项列表[关闭]
【发布时间】:2018-08-04 10:51:37
【问题描述】:

我创建了一个带有 6 个标签的标签栏应用程序。应用启动时显示 4 个选项卡和 1 个“更多”选项卡。及其预期。当用户单击更多选项时,将显示 2 个选项卡。当我单击更多选项时,我看到了 2 个选项卡控制器的列表。当我选择 a tab 时,什么也没发生。它应该被重定向到各自的视图控制器。

【问题讨论】:

  • 显示你尝试过的代码
  • 我只设置了故事板,写在下面的代码用于更多选项页面自定义。,当我删除此代码时,也面临同样的问题。
  • 我认为这可能缺少minimal reproducible example。你能稍微扩展一下吗,也许是代码或错误日志?

标签: ios swift uitabbarcontroller xcode9 uitabbaritem


【解决方案1】:
    let moreview = self.moreNavigationController.topViewController?.view as? UITableView

    moreview?.tintColor = UIColor.darkText
    moreview?.tableFooterView = UIView()
    let headerView: UIView = UIView()
    headerView.backgroundColor = UIColor.clear
    headerView.frame=CGRect(x: 0, y: 0, width: (moreview?.frame.width)!, height: 44)
    moreview?.tableHeaderView = headerView
    moreview?.bounces = false
    if moreview?.subviews.count != nil {
        for cell: UITableViewCell? in moreview?.visibleCells ?? [UITableViewCell?]() {
            cell?.backgroundColor = UIColor.clear
        }
    }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-01-20
    • 1970-01-01
    • 1970-01-01
    • 2014-11-16
    • 2012-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多