Profo
Profo

Reputation: 153

Make view scrollable with IB

How to make the content of view scrollable using IB ?

I know how to do that programmatically, but can't figure out how to that using IB. I have googled, but didn't found useful solution.

Upvotes: 0

Views: 438

Answers (1)

James Bedford
James Bedford

Reputation: 28962

You want to drag a scroll view widget from right-side panel under objects onto the .xib file's view. You can then add other views inside the scroll view by dragging. In this exam I've dragged a UILabel view onto the scroll view to place it inside. You can see the view hierarchy on the left in Xcode.

I've attached a screenshot that shows a section of Xcode 4 which should demonstrate everything you need! Note that the view hierarchy here is as follows:

UIView (Standard UIView that was created by Xcode when I made the .xib user interface file) > UIScrollView > UILabel

enter image description here

Hope this helps!

Upvotes: 2

Related Questions