views:

76

answers:

2

I have an iPad app out on the app store which I'm interested in making an iphone version for. The whole screen is used in the iPad app, with basic strings that display information.

How could I bring all that to the iPhone and make it scrollable? For example, to make it fit on the phone I would have the title on top, then a string stating like name on the left, then under it the name. I need to do this for about 7 items such as address and email, therefore in order to make it all fit it would have to go down below the iPhone screen. How would I be able to make the screen scrollable so I can view what is below it?

I understand table views scroll but the way the information is, having a table view would look weird and would be too overkill if you get what I mean.

Thanks.

+1  A: 

Use a UIScrollView

iWasRobbed
I tried making my view in the view controller .xib file a scroll view and nothing scrolled.
SolidSnake4444
Did you set the scrollview's content height? That's how it knows how much it needs to scroll. If you are adding a bunch of UILabel's, then you can have a method to add those, calculate the height of it all and use that to set the content height. Or you could just guess at it until you get it right.
iWasRobbed
Sorry, for such a late response. I tried that as well. When scroll view was mentioned, I googled tutorials and they want you to create an outlet to the scroll view to make it. I still can't seem to get it to work, even following some tutorials. For your idea, when should I set the content height? viewDidLoad?
SolidSnake4444
You should set the content height after you know whats going into it. For instance, if you add an image that is 500 pixels tall, you should set it after knowing that and add some padding. Here's a quick example I found for you: http://edumobile.org/iphone/wp-content/uploads/2010/03/ScrollImage-2.zip
iWasRobbed
You don't need to set up an outlet to the scrollview if you make it via code. If you make it in interface builder, you would so you know where to add subviews like a UIImageView, etc.
iWasRobbed
+2  A: 

UIScrollView.

For what it's worth, it actually does sound (from your description) that you actually would want to use a UITableView, but maybe I'm misunderstanding.

Gordon Fontenot
But then wouldn't that leave those editable like buttons on the screen?I made the view in the xib file a scroll view yet it doesn't scroll....
SolidSnake4444
Make sure that the ScrollView is the bottom level of the view, and that the other items are subviews of the scrollview. Not sure what you mean by "editable like buttons". If you're talking about the grouped table cells (like in the Settings app, for example), then yes, but you could tweak the look of them with some code, setting backgroundColor, contentViewColor, etc to clear.
Gordon Fontenot
Bottom level as in separate from the view that comes default in the nib or as in on top of the view?
SolidSnake4444
On top of the view, making sure that all your UILabels are subviews of the UIScrollView, not the UIView. This is why I hate IB. Doing this in code is so much easier to explain.
Gordon Fontenot