How can I get a UICollectionView to fill the width of a parent scroll view with Auto Layout without going offscreen?
-
-
Answer:
I've always had problems with UIScrollView and AutoLayout. Check out this guide for how to set up the scroll view itself: http://ehko.co.uk/working-with-uiscrollview-and-auto-layout-in-xcode/ Then just pin the UICollectionView to the inside edges of the UIScrollView.
Jake Peters at Quora Visit the source
Other answers
I don't know if there is a way to do that in AutoLayout. What I would do if I had to accomplish that would be to do it programmatically. You can retrieve the width of the screen where the app is running like [UIScreen mainScreen].bounds.size.width Knowing the size of the screen, you can probably infer the size that the UIScrollView will have (which will obviously depend on how the UIScrollView itself scales with the screen). Then, just set the frame of the UICollectionView to have the width you just figured out.
Manuel Costa
Related Q & A:
- How can I get a web design job in Toronto?Best solution by Yahoo! Answers
- How can I get a loan without a job?Best solution by Yahoo! Answers
- How can I connect a printer wirelessly to my laptop without a router? Which printer would be the best?Best solution by Yahoo! Answers
- How can I get a text alert when I get an email?Best solution by Yahoo! Answers
- How can I get a job at a resort for a Summer?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.