How to Put a static UIButton Overlaying a UITableView

后端 未结 1 1517
别跟我提以往
别跟我提以往 2021-01-26 17:46

Basically, I wanna create a static UIButton on top whether or not the table view is scrolled. However, I tried to add the UIButton as the subview of the UIView and make it on th

1条回答
  •  有刺的猬
    2021-01-26 18:01

    You're using a table view controller, so self.view is the table view. A table view is a scroll view, so the view scrolls along with everything else.

    You should use a regular view controller with a table as a subview instead.

    Alternatively, you could try resetting the view's frame in the scrollViewDidScroll: scroll view delegate method, but I think the view would still jitter a bit.

    Finally, you could add the button directly to the UIWindow, but that's likely to bring up a whole host of other problems with rotations, animations, and transitions.

    0 讨论(0)
提交回复
热议问题