具有水平分页的UIScrollView内的UITableViewController [英] UITableViewController inside UIScrollView with Horizontal Paging

查看:105
本文介绍了具有水平分页的UIScrollView内的UITableViewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这种情况:

我需要水平滚动,并且每页都需要表格视图.这就像新闻应用程序一样,它应该显示来自不同类别的新闻,当在一个水平方向上滚动时,应该显示一个类别中的大约30条新闻,并且可以垂直滚动.

I need horizontal scrolling, and table views inside every page. This is something like news app, it should display news from different categories, when scrolled in one horizontal direction, and inside one category it should display about 30 news, vertically scrollable, of course.

我已经成功完成了我所需要的,但是...

I have successfully done what i need, but...

我有以下情况:

UINavigationController
|__ UIViewController, which contains ScrollView and PageControl
    |__ UITableViewController, which holds data in rows, and is displayed inside parent, which is actually ScollView

我知道这不是理想的解决方案,但至少可以奏效.作为基础,我使用了在链接.我不是使用简单的viewController添加到ScrollView,而是使用TableViewController,因此基本上是将tableController.tableView添加到ScrollView.

I know that this is not an ideal solution, but at least it works. As a base, i used Apple's code and tutorial for PageScroll found on this link. Instead of simple viewController to add to ScrollView, i used TableViewController, so basically i add tableController.tableView to the ScrollView.

我也知道,在scrollview中添加tableViews就像在卡车中添加一辆汽车并驾驶该汽车,但是我找不到更合理的方法来做同样的事情.

I know, also, that adding tableViews inside scrollview is sort of adding a car inside a truck and driving that car, but i couldn't find more reasonable way of doing same thing.

因此,我需要您考虑如何使用其他方法来完成此操作.为此,我使用情节提要和iOS 5,一切似乎(看起来)现在很混乱.

So, i need your thoughts about how this can be accomplished using some other approach. I use storyboarding and iOS 5 for this, and everything seems (and looks) messy right now.

非常感谢.

推荐答案

几个月前,我做了类似的事情,就像这样:

I did something similar a few months ago, and it was like this:

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