在UITableView中实现隐藏的段控件

时间:2014-07-16 17:20:47

标签: ios uitableview uiscrollview

我想在UITableView的顶部放置一个隐藏的段控件,就像iBooks中的搜索栏一样。然后我找到了Creating a hidden UISegmentedControl in a UITableView。通过实施UIScrollViewDelegate方法:

- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView
- (void)scrollViewDidScroll:(UIScrollView *)scrollView

我可以显示和隐藏隐藏的段控件。但是这个段控件无法响应触摸。只是桌面视图再次覆盖顶部区域,就像原始帖子一样。

所以我想知道如何让段控件对触摸作出反应。我找到了类似的东西:

scrollView.userInteractionEnabled = YES;
scrollView.canCancelContentTouches = NO;
scrollView.delaysContentTouches = NO;

但没有用。(我使用self.tableView.userInteraction...

有人帮我一把吗?

0 个答案:

没有答案
相关问题