0

I would like to ask a question. Now i'm training about iPhone Programming. I'm just new baby in iOS Programming. I want to add navigationbar in UIPickerView's upper place. It's like the UINavigationBar in MainView. I just want to add on UIPickerView. and also i want to add Done button in that NavigationBar. After i touched that done button, my view will back to main view. How can i do that? Please answer me if you know. I hope you understand my question. Sorry for my bad english. Thanks you for reading.

Fire Fist
  • 7,032
  • 12
  • 63
  • 109
  • 1
    Just check this out, this will help you - http://stackoverflow.com/questions/1262574/add-uipickerview-a-button-in-action-sheet-how – rishi Jan 14 '12 at 08:37

2 Answers2

0

When I understand you correct, you have one navigation controller and want to add to this navigation controller a new UIView with a UIPickerView which comes up after pushing the edit Button and hide when you press done button?

Then I would create a new UIViewController in Interface Builder, add the UIPickerView to this View. Put this in the correct place. In the new view controller add a property of type UIPickerView and connect the IBOutlet of PickerView to the FilesOwners Property. In the Controllers method viewDidLoad you set then for example:

[self.datePicker setHidden: YES];
self.navigationItem.rightBarButtonItem = self.editButtonItem;

This button calls automatically the method setEditiong: on pushing. You can reimplement it for example:

- (void)setEditing:(BOOL)editing animated:(BOOL)animated {

[super setEditing:editing animated:animated];

if (editing) {       
    [self.datePicker setHidden:NO];
} else {
    [self.datePicker setHidden:YES];
}

}

Gerrit
  • 2,515
  • 5
  • 38
  • 63
0

All you do is drag a navigation bar on the top of the uipicker. Im assuming your wanting this UIPicker to popup, so just create a view just for the picker, drag in a navigation bar and uipicker into the view, then adjust the size of your view window for the bar and uipicker. THen you just need to hookup the the bar and uipicker to file's owner as delegates. Make sense?

Jason
  • 650
  • 2
  • 10
  • 33