【问题标题】:Transition method when there is one uitableview on one uicollectionview cell一个uicollectionview单元格上有一个uitableview时的过渡方法
【发布时间】:2019-01-02 22:33:28
【问题描述】:

在一个uicollectionviewcell之上有一个uitableview。 即使您点击此 uitableview 单元格,它也不会传输。

协议如下。

class (the name of this collectionViewCell): UICollectionViewCell, UITableViewDelegate, UITableViewDataSource {...

为了进行过渡, 因为有一个UIViewController底层collectionViewCell, 我想用那个navigationController

我在didSelectRowAtindexPath 中做了如下代码:

uiVC = UIViewController()
self.uiVC? .navigationController?. pushViewController(DummyViewController(), animated: true)

但是,它不能进行过渡。 过渡方法不正确吗? 如果你知道,请告诉我。

【问题讨论】:

    标签: swift xcode uitableview uicollectionview


    【解决方案1】:

    您的 uiVC 没有 UINavigationController。

    uiVC = UIViewController()
    self.uiVC? .navigationController?. pushViewController (DummyViewController(), animated: true)
    

    在 awakeFromNib 处编写代码:

     uiVC = UIViewController()
     var navigationController = UINavigationController(rootViewController: uiVC)
     self.addSubview(navigationController.view)
     // TODO: add constraints
    

    你会看到过渡。

    【讨论】:

    • 对不起。我不使用情节提要。
    • 如何在 override init 中写入?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-07
    • 1970-01-01
    相关资源
    最近更新 更多