简体   繁体   中英

UIScrollView tiled subview with Auto Layout

I look for this answer everywhere but I couldn't find satisfied answer so far.

I have UIScrollView with Tiled UITableView as subviews . I did it like it was showed in WWDS 2012 video and it work fine. But now I would like to use Auto Layout and I would like to know right and easy solution for this.

Because if I understand Auto Layout correct I can't specify constraints to subviews because it will be removed during tiling.

image representation of problem :

在此处输入图片说明

When tiling only one UITableView is on the scroll view, other are stored in NSSet but removed from superview.

But when you start scrolling, UItableView are added to scroll view.

在此处输入图片说明

I think this implementation is obsolete today. Check out UICollectionView documentation. And for paging you can find some already implemented solutions too. For example:

http://mobileappdev.learningtree.com/2012/12/13/paging-with-collection-views-part-1/

One more example:

http://adoptioncurve.net/archives/2013/04/creating-a-paged-photo-gallery-with-a-uicollectionview/

And check out the article from this dude, I like his posts:

http://khanlou.com/2013/04/paging-a-overflowing-collection-view/

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