How to animate the imageview outside of its parent layout?

How can I get a UICollectionView to fill the width of a parent scroll view with Auto Layout without going offscreen?

Jake Peters at Quora Visit the source

Was this solution helpful to you?

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

Just Added Q & A:

Find solution

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.