Ste*_*ann 5 iphone objective-c uitableview uiscrollview ios
我想为一个节日做一个阵容。你可以在这里看到我想要实现的目标。

您可以向各个方向滚动,水平 - 垂直和从左到右角(不知道正确的英语单词)。如果您在一个部分滚动,其他部分应该随之滚动。
我的问题是知道你怎么能做到这一点?我正在寻找几天才能使其正常工作,但没有找到好的解决方案......
UITableView 中的行不会在 UITableView 内滚动。一种解决方案是使用 UIScrollView 然后在里面添加 UITableView。这个 UIScrollView 将与您的 UITableView 现在具有相同的大小,但 UIScrollView contentSize 属性将具有相同的高度,但它会有更大的宽度。

UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(x, x, x, x) style:...]
[scrollView addSubview:tableView];
// Set the size of your table to be the size of it's contents 
// (since the outer scroll view will handle the scrolling).
CGRect tableFrame = tableView.frame;
tableFrame.size.height = tableView.contentSize.height;
tableFrame.size.width = tableView.contentSize.width; // if you would allow horiz scrolling
tableView.frame = tableFrame;
// Set the content size of your scroll view to be the content size of your 
// table view + whatever else you have in the scroll view.
// For the purposes of this example, I'm assuming the table view is in there alone.
scrollView.contentSize = tableView.contentSize;
| 归档时间: | 
 | 
| 查看次数: | 17642 次 | 
| 最近记录: |