简体   繁体   中英

IOS Swift: Scrolling child views doesnt scroll the parent view

My iOS app view has a cover Image at top (100% width, 30% height) and a Table for the rest of the screen. To acheive this kind of layout, I am using "Container Views" in my view. So I have Two Container Views: 1st Container is normal view controller with UIImage. 2nd Container is Table View Controller. This can have many entries.

When I run this and try to scroll, only the second container scrolls in place. 1st container remains at the top.

How can I make the full parent view to scroll instead of just second view. (Are container views right bet for this kind of requirement and layout?)

you may create a new cell called "HeaderImageCell", and make the first cell to be "headerImageCell"

"Container Views" is not needed at this point.

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