滚动视图内的表视图存在问题
可能的重复:
iPhone 中的表格视图问题
我有以下内容:
.h 文件:
UITableView *catalogTable;
UIScrollView *scrollView;
.m 文件
- (void)viewDidLoad
{
NSLog(@"BoiteAOutils");
[super viewDidLoad];
catalogTable.backgroundColor = [UIColor clearColor];
catalogTable.layer.cornerRadius = 10.0;
scrollView.layer.cornerRadius = 15;
[self.view addSubview:scrollView];
[scrollView setShowsVerticalScrollIndicator:NO];
catalogTable.scrollEnabled = NO;
catalogTable.layer.cornerRadius = 15;
[scrollView addSubview:catalogTable];
nameCatalog = [myAudiAppDelegate sharedAppDelegate].dataHandler.catalogueList;
loadingView.hidden=YES;
}
I在 xib
文件中创建了一个 scrollView
和一个 tableView
。 一切都很好,结果如下:
http://i53.tinypic.com/dzgqx3.png
我对结果非常满意,问题是,一旦我开始上下滚动表格,它就不会移动。我看不到表格的全部内容......只有单元格显示在这张照片。 我哪里错了?谢谢你:)
Possible Duplicate:
issue with tableview in iphone
I have the following:
.h file:
UITableView *catalogTable;
UIScrollView *scrollView;
.m file
- (void)viewDidLoad
{
NSLog(@"BoiteAOutils");
[super viewDidLoad];
catalogTable.backgroundColor = [UIColor clearColor];
catalogTable.layer.cornerRadius = 10.0;
scrollView.layer.cornerRadius = 15;
[self.view addSubview:scrollView];
[scrollView setShowsVerticalScrollIndicator:NO];
catalogTable.scrollEnabled = NO;
catalogTable.layer.cornerRadius = 15;
[scrollView addSubview:catalogTable];
nameCatalog = [myAudiAppDelegate sharedAppDelegate].dataHandler.catalogueList;
loadingView.hidden=YES;
}
I created a scrollView
and a tableView
in the xib
file.
Everything works great and the result looks:
http://i53.tinypic.com/dzgqx3.png
I'm very haapy with the result, the problem is that as soon I start scrolling the table up and down it doesn't move.I can't see the whole content of the table...only the cells showed in this picture.
Where am I going wrong? Thank you:)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您永远不应该将
UITableView
放入UIScrollView
中。引用 文档 <代码>UIScrollView:您应该重新考虑您想要的布局。希望有帮助!
You should never put a
UITableView
inside aUIScrollView
. Quoting the documentation for aUIScrollView
:You should rethink how you want your layout. Hope that Helps!