滚动视图中的表视图问题 [英] problem with the table view inside a scrollview

查看:54
本文介绍了滚动视图中的表视图问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能的重复:
iphone 中的tableview 问题

我有以下几点:

.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;
}

我在 xib 文件中创建了一个 scrollView 和一个 tableView.一切正常,结果看起来:

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:)

推荐答案

你不应该把 UITableView 放在 UIScrollView 中.引用文档以获得<代码>UIScrollView:

You should never put a UITableView inside a UIScrollView. Quoting the documentation for a UIScrollView:

重要提示:您不应将 UIWebView 或 UITableView 对象嵌入到UIScrollView 对象.如果这样做,可能会导致意外行为因为两个对象的触摸事件可能会混淆和错误处理.

Important: You should not embed UIWebView or UITableView objects in UIScrollView objects. If you do so, unexpected behavior can result because touch events for the two objects can be mixed up and wrongly handled.

您应该重新考虑您想要的布局.希望有帮助!

You should rethink how you want your layout. Hope that Helps!

这篇关于滚动视图中的表视图问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆