Home  >  Q&A  >  body text

objective-c - ios页面布局

问个布局的问题,整个页面可以上下滑动,圈住的地方又可以左右滑动。

我的思路:
我想的整个页面是 tableview,圈住的地方是个cell。然后cell又是个 collectionview。collectionview的一个item是个tableview
但是对于圈住的地方cell的高度 是由tableview的数据源决定的。
想问下大家有什么好的思路吗

PHP中文网PHP中文网2732 days ago589

reply all(2)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-04-28 09:07:46

    It is not suitable to use UITableView for the entire page. There are sliding interactions up and down, and there are subscription events. So if there is too much logic in one cell, your ViewController will become bloated and difficult to maintain.
    My idea is to create a parent container ViewController for the entire page, add a childViewController


    upper part

    for a ViewController


    lower part

    add a UI for a ViewController

    TableView, according to the background If the given interface has multiple network requests, it can encapsulate a ViewControllerModel.

    reply
    0
  • 高洛峰

    高洛峰2017-04-28 09:07:46

    The entire interface is a large scrollView, surrounded by a small scrollView. The three tableViews in the small scrollView slide horizontally (the content height of the large scrollView is the header view + the screen height, and the height of the small scrollView and tableView is the screen height). Remember to judge the tableView well. Pull-up and pull-down with large scrollView

    reply
    0
  • Cancelreply