CodeGeek123
CodeGeek123

Reputation: 4501

UIScrollViews and Adding Components on them

I need to add buttons to a UIScrollView so that it appears on all screens when you scroll. However a UIScrollView is just a view and not a controller therefore i cant add components to it. What is the best method to approach this? I can add the buttons on the subviews which are viewcontroller views however thats a little too much work and i was thinking maybe not the best option. How can i simply add one button the the UIScrollView view and use it universally for all its views?

Upvotes: 0

Views: 212

Answers (2)

Krrish
Krrish

Reputation: 2256

Create a UIView
Add UIScrollView as subView
Then Add a UIButton to UIView on top of UIScrollView

Upvotes: 1

ikuramedia
ikuramedia

Reputation: 6058

Create a new UIView and make the UIScrollView a subview of it. Then add the components to the UIView too.

Upvotes: 1

Related Questions