当我滚动页面时,单元格与顶视图重叠

时间:2018-07-06 14:08:50

标签: ios swift layout

我正在使用SlackTextViewController框架制作一个在顶部聊天中具有过滤器的应用程序,但是由于我不知道如何以编程方式设置它,因此我使用了StoryBoard。

在蓝色视图中是collectionView,在灰色视图中是简单视图。我将ViewController设置为使用tableView留在该灰色区域:

image

但是当我滚动页面时,tableviewcell在蓝色的collectionview上方。我使用以下代码在灰色视图中设置了视图控制器:

let chatView = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "ChatList") as! ChatViewController
addChildViewController(chatView)
dynamicView.addSubview(chatView.view)
chatView.view.frame = dynamicView.frame
chatView.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
chatView.didMove(toParentViewController: self)

0 个答案:

没有答案
相关问题