Tice
Tice

Reputation: 103

UIScrollView with variable contentSize

I'm trying to create a horizontally scrollable UIScrollView which has variable content, consisting of buttons. I want it to be possible for the user to scroll side to side in order to reach different buttons. The way I understand it, though, is that I need a fixed frame (size of content) to scroll around on, which I don't have (since the content is variable). How can I go about this? How do I get the contentSize which is relative to the buttons and what should define the contentSize?

Screenshot of how the buttons are setup is found below. When more buttons are loaded (more than 8), the user should be able to scroll to the side in order to see and use the additional buttons. enter image description here

Edit: Any help? I'd rather not go to the trouble of delving into UICollectionViews!

Upvotes: 0

Views: 50

Answers (1)

Fred Faust
Fred Faust

Reputation: 6800

You may want to check out a UICollectionView, it might be less work and give you what you want.

Upvotes: 1

Related Questions