
Im working on a scroll view design where the ‘black boxes are supposed to be image items.The blue box is the scroll view. Is it possible to have a zig zag format? And for the count of the box depends on the images available on the internet. So it is more dynamic. Any suggestions would be greatly appreciated!
Yes, you can definitely do this.
You will be positioning UIImageView objects inside the content area of a UIScrollView. Simply set the
contentSizeof your UIScrollView to reflect the size of your blue box. Think of UIScrollView as a film strip. The UIScrollView is the visible portion of your film, and the entirety of the film is your contentSize.Now position each UIImageView by setting its frame as you wish and then add it as a subview to the scrollview. If you find yourself needing more horizontal space, you can resize the contentSize accordingly.