How to place a button “over” the UITableView like Foursquare

邮差的信 提交于 2019-12-11 21:43:34

问题


As the title, I'd like to place a button over the UITableView, like what they did to the check-in button in Foursquare: you can still roll the table view up and down, but the button will stay at the same position.

Any tips? Thanks!

!


回答1:


If you are using a view controller with a table view inside it, just add another subview of the view, above the table view. If you are using a table view controller, it is a bit more tricky. You can add the button as a subview of the table view, and when the table view scrolls, listen to the scroll view delegate methods of the table view and move your button to offset the scroll, so it appears stationary to the user.



来源:https://stackoverflow.com/questions/20203784/how-to-place-a-button-over-the-uitableview-like-foursquare

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!