Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Sep 22, 2008, 04:14 PM   #1
MarcVanH
macrumors newbie
 
Join Date: Sep 2008
Create long scrolling page of controls in IB?

I am trying to create a "settings" page - the single page kind that is really long and scrollable.

I know I can do this with a Table view (like in UICatalog), but since I just need a single page of controls, I was hoping to do it without all the complexities of a table view.

Can anyone tell me how to create a long, scrollable view, that I can throw like 20 buttons and sliders on, in interface Builder?
MarcVanH is offline   0 Reply With Quote
Old Sep 22, 2008, 04:25 PM   #2
tsornin
macrumors newbie
 
Join Date: Jul 2002
You could use UIScrollView ... in IB just start with a view object and change its parent in the inspector. You can then set the height of the view to larger than the actual iphone window, and add whatever controls you need in the bigger view window.

I'm messing around with something similar, although one problem I haven't sorted out yet is how to deal with several scrolling UITextViews on top of a scrollview. When I test it in the simulator, it scrolls the first text view, rather than the entire scrollview.
tsornin is offline   0 Reply With Quote
Old Sep 22, 2008, 04:32 PM   #3
MarcVanH
Thread Starter
macrumors newbie
 
Join Date: Sep 2008
I played with UIScrollView for hours with no luck. Gave up assuming it was just for images, etc.

Can you walk me through it a bit more specifically?
MarcVanH is offline   0 Reply With Quote
Old Sep 22, 2008, 04:45 PM   #4
tsornin
macrumors newbie
 
Join Date: Jul 2002
Quote:
Originally Posted by MarcVanH View Post
I played with UIScrollView for hours with no luck. Gave up assuming it was just for images, etc.

Can you walk me through it a bit more specifically?
In interface builder, create a new->view. Click on the view object, and open the inspector window. Look under view identity and change the class identity to "UIScrollView". Then go to the size tab (in the inspector) and change the height from 480 to 600 (or whatever).

Then you can click on your scroll view object to bring up the view window, and drag whatever controls you want from the IB library into the view.

Of course you'll still have to set up the appropriate IBOutlet variables and IBAction methods for all your controls (and possibly some delegate methods, depending on what controls you add) in the view controller.

Only caveat is there doesn't seem to be any way to scroll the scroll view in interface builder itself, so I guess your scrollview is pretty much limited to the height of your screen. If you wanted a longer view you'd probably have to do it all programmatically, rather than using interface builder...
tsornin is offline   0 Reply With Quote
Old Sep 22, 2008, 05:01 PM   #5
MarcVanH
Thread Starter
macrumors newbie
 
Join Date: Sep 2008
I swear I tried that a few times, but I'll give it another go. Thanks!
MarcVanH is offline   0 Reply With Quote
Old Sep 22, 2008, 05:44 PM   #6
MarcVanH
Thread Starter
macrumors newbie
 
Join Date: Sep 2008
Still no luck. I can make the view, change its class, make it's height real tall, and add controls no problem. But when I display it, no scrolling.

How are you displaying the view? With some kind of controller?
MarcVanH is offline   0 Reply With Quote
Old Sep 22, 2008, 05:50 PM   #7
PhoneyDeveloper
macrumors 68030
 
PhoneyDeveloper's Avatar
 
Join Date: Sep 2008
There's no need to first create a UIView and then change its class to UIScrollView. Just use the UIScrollView from the catalog.

I've attached an example project. The one line that's required sets the content size for the scrollview. The rest is done in IB.
Attached Files
File Type: zip ScrollViewTest.zip (12.7 KB, 2381 views)
PhoneyDeveloper is offline   0 Reply With Quote
Old Sep 22, 2008, 05:58 PM   #8
MarcVanH
Thread Starter
macrumors newbie
 
Join Date: Sep 2008
Perfect! Thank you very much.
MarcVanH is offline   0 Reply With Quote
Old Sep 23, 2008, 07:06 AM   #9
indiekiduk
macrumors regular
 
Join Date: Jul 2005
Location: Glasgow, Scotland
Code:
[scrollView flashScrollIndicators];
This should be in viewDidAppear
indiekiduk is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
How do you create a title page san001 Digital Video 4 Apr 9, 2014 03:23 AM
Looking for tutorial to create flipping page book umen iPhone/iPad Programming 1 Apr 30, 2013 07:54 PM
Scrolling with mouse 3 times goes to top/end of page Arv3n Mac Basics and Help 0 Jan 9, 2013 02:42 PM
iScanner (Scan, Fax, Print and Create Multi-page PDF Documents) razihassan iPhone and iPod touch Apps 3 Aug 3, 2012 03:41 PM
Create an HTML page with forms that allow you to add and remove email addresses Kilamite Web Design and Development 1 May 31, 2012 12:39 PM

Forum Jump

All times are GMT -5. The time now is 05:10 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC