gpt4 book ai didi

ios - UiView 固定在 UiTableViewController 之上

转载 作者:行者123 更新时间:2023-11-30 13:05:45 24 4
gpt4 key购买 nike

我需要将 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com