简体   繁体   中英

ioS Scroll View with dynamic table View

I want to create a “ViewController” Scene with a “Scroll View” and in this view there should be a “Table View” at the top, 1 “segmented Control and 2 tables at the bottom. The “Segmented Control” should switch the bottom table views. Like in this picture:

在此处输入图片说明

My problem with this scene is that the table should have a dynamic height.

I need the bar over the complete page and not in the individual tables. Is it possible to create such a scene and if yes, which constraints do I have to set? I hope you can help me! Thanks a bunch!

tableView inside scrollView is a disastrous idea, because

  1. tableView itself have its own scrollView .

  2. Scrolling will be very sticky and it may freeze UI.

The best solution comes on my mind is to take single tableView and manage multiple sections .

The Green portion will be your first section.

Segment control will be second.

and blue section will be third.

In this way you can achieve both dynamic height as well as single scroll bar condition.

Let me know if it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM