UIPopoverController中UITableViewController 中selectRowAtIndexPath: animated:scrollPosition滚动不到的解决方法
来源:互联网 发布:网络主播毒害中国 编辑:程序博客网 时间:2024/06/06 04:49
UIPopoverController中UITableViewController 中selectRowAtIndexPath: animated:scrollPosition滚动不到指定的cell的解决方法
按道理 ,下面的代码就可以滚动到指定的 cell并且选中 :
NSIndexPath * index = [NSIndexPath indexPathForRow:selectItemIndex inSection:0]; [self.tableView selectRowAtIndexPath:index animated:NO scrollPosition:(UITableViewScrollPositionTop)];
可是发现,如果是row 比较小,不到底部没啥问题,可以让指定的cell滚动到顶部,可是如果是靠近底部的cell,就不能让指定的cell 显示在可见范围内了。而且如果是用UIViewController来直接弹出 UITableViewController没问题,但是用PopOver 来弹出就不行。
后面发现了一个解决方法:
将这段代码封装成一个函数:
didSelectToProperCell
然后函数里面去调用这段代码
然后调用改成:
[self performSelectorOnMainThread:@selector(didSelectToProperCell) withObject:nil waitUntilDone:NO];
而不是直接去调用,就解决了这个问题。这是一种可用的解决方法。
0 0
- UIPopoverController中UITableViewController 中selectRowAtIndexPath: animated:scrollPosition滚动不到的解决方法
- Android 中 ScrollView滚动不到最底端的解决方法
- Android 中 ScrollView滚动不到最底端的解决方法
- Android 中 ScrollView滚动不到最底端的解决方法
- ipad中 UIPopoverController 的使用方法
- iOS中UIPopoverController的使用
- WPF中ListView在不滚动数据的情况下只能取到当前显示的数据,取不到滚动条以下的数据解决方法
- UITableViewController中显示navigationItem按钮
- 在UITableViewController对应的storyBoard中添加view
- swift语言中子类继承UITableViewController需要注意的点
- pom.xml 中properties 在别的配置文件中读取不到的解决方法
- Android 中listview 和scrollview 滚动冲突事件的解决方法
- React-Native项目中使用动画-Animated
- UIPickerView在UIPopoverController中正确显示方法
- UIPickerView在UIPopoverController中正确显示方法
- UIPickerView在UIPopoverController中正确显示方法
- UIPopoverController和UIActionSheet在iPad中使用
- hiberante中因为缓存机制造成新存或者修改的数据查不到的解决方法
- Codeblocks 使用汇总
- 查找字符串中每个字符出现的个数
- 聚类算法
- sqoop的安装与使用
- hdoj 1873 看病要排队(优先队列的运用)
- UIPopoverController中UITableViewController 中selectRowAtIndexPath: animated:scrollPosition滚动不到的解决方法
- CCConfiguration作用
- Codeforces 560 A. Currency System in Geraldion(想法题)
- 自定义控件-仿iphone之ToggleButton&VoiceSeekBar
- GRE写作必备句型
- VS平台上Python开发一些小tips
- Warning:can't find referenced class.
- java过滤微信中Emoji表情
- git和gitHub在Eclipse和AndroidStudio中的使用