2

I am using a storyboard, and I have one screen where all the elements do not fit into the 3.5 inch screen.

What I am trying to do is put the screen that I want to use in focus, go to Editor --> EmbedIn --> But the scroll-view option is disabled.

Is there something that I am not doing correctly? What is the correct way to make my screen scrollable?

Thanks!

Genadinik
  • 18,153
  • 63
  • 185
  • 284

1 Answers1

1

Command + Click on the objects you want embedded in the scroll view, then do a Editor -> Embed In -> Scroll view and it should be enabled. My guess is you have the highest level view selected (or nothing at all selected), which you can't do because that view needs to stay on top.

Sean
  • 1,045
  • 7
  • 22
  • thanks - do you mean control-click on each element on the screen? – Genadinik Feb 04 '13 at 15:21
  • Apologies, I mean COMMAND + click. Switching between systems messes me up =p You just select all Interface items you want embedded in that scroll view first, then click that Embed In item from the editor menu – Sean Feb 04 '13 at 15:22
  • it didn't quite work for me. I went through each page element, highlighted it, and clicked editor -> embed -> scrollview but when I ran the app it made some of the elements disappear from the screen and I still could not scroll. – Genadinik Feb 04 '13 at 15:24
  • 1
    Well that probably means you did it correctly then. The next thing you need to do is define the scroll view's content size, which is doable programatically. Check out this thread on how to do that http://stackoverflow.com/questions/1135163/how-do-i-use-uiscrollview-in-interface-builder – Sean Feb 04 '13 at 15:30
  • Or should I maybe have put all the screen elements inside a scroll-view (that I can drag from the left side of the screen) in the beginning? If so, I am kind of confused about how to have both a UIScrollView and a UIViewController – Genadinik Feb 04 '13 at 15:30
  • You still need a subclass of UIViewController to perform all the logic, a scroll view is a subclass of UIView (which also needs a UIViewController) – Sean Feb 04 '13 at 15:32