我需要将 UIView 固定在 UITableViewController 之上(如标题)。我试过这个:
override func scrollViewDidScroll (scrollView: UIScrollView) {
var fixedFrame: CGRect = self.uiTopView.frame;
fixedFrame.origin.y = scrollView.contentOffset.y;
self.uiTopView.frame = fixedFrame;
}
但是它不起作用,我不知道为什么。有人有什么想法吗?
最佳答案
这是无法完成的,实现此目的的一种方法是在UIContainerView
中添加 UITableViewController
所以结构如下:
ViewController1包含一个UIContainerView
这个容器 View 嵌入了segue
到你的tableViewController。
然后您可以将 View 添加到ViewController1。
关于ios - UiView 固定在 UiTableViewController 之上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39396822/