简体   繁体   中英

Custom view hides UITableViewCell

When I click on a UITableViewCell a custom view shows up. But sometimes this view hides the selected UITableViewCell .

I can solve this problem by using:

[self.tableView scrollToNearestSelectedRowAtScrollPosition:UITableViewScrollPositionTop
                                                  animated:YES];

But this seems only to work if there are more cells than the tableview can display on the screen.

Can I somehow force the tableview to scroll anyway? Or do I need to go a different way?

一种快速的解决方案是简单地将表视图向上滚动自定义视图的高度,然后通过设置表视图的contentOffset向下滚动。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM