如何将按钮“放在"上方UITableView像Foursquare [英] How to place a button "over" the UITableView like Foursquare

查看:105
本文介绍了如何将按钮“放在"上方UITableView像Foursquare的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为标题,我想在UITableView上放置一个按钮,就像他们对Foursquare中的签入按钮所做的那样:您仍然可以上下滚动表格视图,但是该按钮将保持在相同的位置.

有什么秘诀吗?谢谢!

解决方案

如果您正在使用内部带有表视图的视图控制器,则只需在表视图上方添加该视图的另一个子视图.如果您使用的是表视图控制器,则比较棘手.您可以将按钮添加为表视图的子视图,并且在表视图滚动时,请听取表视图的滚动视图委托方法,然后移动按钮以抵消滚动,因此它对用户而言似乎是固定的.

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!

!

解决方案

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.

这篇关于如何将按钮“放在"上方UITableView像Foursquare的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆