【发布时间】:2013-04-12 14:09:08
【问题描述】:
使用 Xcode 4.6.1、iOS SDK 6.1,创建一个新的 Master-Detail iOS 应用程序(使用 ARC,没有情节提要)并在 DetailViewController 中将 configureView 设置为:
- (void)configureView
{
UITableView *lTableView = [[UITableView alloc] initWithFrame: self.view.frame];
lTableView.scrollsToTop = YES; // just to emphasise, it is the default anyway
lTableView.dataSource = self;
[self.view addSubview: lTableView];
}
然后我通过返回 100 个虚拟 UITableViewCells 来确保 UITableView 中有足够的数据,似乎点击状态栏不会将表格视图滚动到顶部。
我在这里缺少什么明显的东西?
【问题讨论】:
-
设置后试试-> lTableView.delegate = self;
-
嗨巴拉。试过了,没用。
-
你的 DetailView 中有多个 Scrollview 吗?
-
如果您的 DetailView 中有多个滚动视图,那么这可能会对您有所帮助 - > stackoverflow.com/a/8960080/1059705