views:

342

answers:

3

I have a UIView where has so many elements like Text Field, Date Picker, and Picker View to add data to my app. This won't make it in a screen in Interface Builder. In my mind, user will scroll down to insert them. Is there a way to achieve this?

Thanks

A: 

AFAIK this is not the standard behaviour for iPhone application. You can create tableView with names of properties and show some other view(with datePicker ot textFields) to enter value when the user clicks the row of the table.

Morion
Yes, I'll use this approach to edit current data. But in order to add data I should provide the user with datePicker and selection of data from pickerView and several text fields. Have a suggestion other than my approach, so I can implement it here?
Ber Biji II
+1  A: 

How to setup a view in Interface Builder that is taller than 480 pixels.

This will be done using two xib files:

MainView.xib is the view for MainViewController, it is 460 pixels tall.
TallView.xib is a 600 pixel tall view (see below for how to do this in IB).

MainViewController only contains a UIScrollView. All your content should be in TallView.xib

In MainViewController, override viewDidLoad and use the following code:

viewDidLoad:

- (void)viewDidLoad {

    //load your TallView.xib into a UIView object
    NSArray *nibParts = [[NSBundle mainBundle] loadNibNamed:@"TallView" 
                                                      owner:nil 
                                                    options:nil];
    //first object is the view
    UIView *tallView = [nibParts objectAtIndex:0];

    //add tallView to scrollView 
    [scrollView addSubview:tallView];

    //set content size to same dimensions as TallView.xib
    scrollView.contentSize = CGSizeMake(320, 600);
}

How to create a view taller than 480 pixels in Interface Builder

Override the height of a xib beyond 480 by first setting the simulated interface elements to "none", and then change the height.

See two screen shots: alt text

alt text

bentford
Any idea to add elements in xib after the space run out at the buttom? I'll be using datePicker, pickerView, and several textFields. Thanks
Ber Biji II
when i run this, i get a key undefined for key 'view' error. Any idea?
joec
joec, post as another stackoverflow question and I'll try to answer.
bentford
A: 

I'd suggest a UIScrollView. I'm not quite sure if it will do everything that you need to do, but it's worked for me when I needed to have a scrolling view.

Jason B