0

Check out the Facebook app. When you click on All Stories in the navbar it slides up a UIPickerView ontop of their UITableView.

enter image description here

I would like to simulate this same behavior in my app. How can I slide up a UIPickerView like this?

Update: This is how I am creating my PickerView:

CGRect pickerFrame = CGRectMake(0, 320, 320, 0);

    UIPickerView *pickerView = [[UIPickerView alloc] initWithFrame:pickerFrame];
    pickerView.showsSelectionIndicator = YES;
    pickerView.dataSource = self;
    pickerView.delegate = self;

    [[[UIApplication sharedApplication] keyWindow] addSubview:pickerView];

Id like to animate it from the bottom of the screen up.

Sheehan Alam
  • 60,111
  • 124
  • 355
  • 556
  • are you asking for specific code on how to animate a uiview or just how to accomplish get the uipicker to appear that way? – Ryan Ferretti Oct 24 '11 at 20:45
  • yeah... I've used this concept with iAds as well. If you grab the iAd suite sample code they animate a view from the bottom in one of them (don't have the link right now). – Ryan Ferretti Oct 24 '11 at 20:48
  • I have a UITabBar on the bottom. How would I get the UIPicker to cover the tabbar? – Sheehan Alam Oct 24 '11 at 20:55
  • I would go with something like the actionsheet... this question might help you http://stackoverflow.com/questions/1262574/add-uipickerview-a-button-in-action-sheet-how – Ryan Ferretti Oct 24 '11 at 20:59
  • Updated my question with some code. Wondering how I can animate the picker up? Right now it appears over the UITabBar, but want to be able to animate from the bottom. – Sheehan Alam Oct 24 '11 at 21:37
  • My guess is that you need to add the picker to the main window which holds the UITabBar... that way it will be on top of it (bringToFront). I'll have my mac later tonight and try to get you some code. – Ryan Ferretti Oct 25 '11 at 15:08

1 Answers1

1

My guess is that they are just creating a uiview off of the bottom of the screen with a uipicker... then animating the frame's Y up.

UPDATE:

In fact, the UIPickerView is just a UIView so you wouldn't even need to have a wrapper UIView... just add the picker as the top view of your window with the top of its frame just below the bottom of the window.

Ryan Ferretti
  • 2,891
  • 2
  • 27
  • 37