tags:

views:

65

answers:

3

I am trying to create a menu that slides up from the bottom of the screen just like the multitasking bar in iOS4. Any ideas how to do this? (I looked into UIViews and commitAnimation, but it didnt't quite do what I needed) Are there any examples of this?

+1  A: 

One way to do this is to create a scroll view that is larger in the vertical dimension, and make the view scroll when some event is triggered.

Simon
A: 

It's just a scroll view with image views inside. For the tap and hold, you'll have to do some UITouch work, but it's not a whole lot of work.

Matt S.
+2  A: 

You need to add a subview to your content view, and position it just off screen. Then when you want to show it, you reposition the frame inside some UIView animation calls. Here's an example of code that I use to show a view sliding in:

-(void)showWorkoutControls {
    CGRect frame = optionsView.frame;
    frame.origin.y = 340.0;

    workoutPicker.userInteractionEnabled = NO;
    [workoutPicker hideTiles];

    [UIView beginAnimations: @"showWorkoutControls" context: nil];
    [UIView setAnimationDelegate: self];
    [UIView setAnimationDidStopSelector: @selector(animationFinished: finished: context:)];
    [UIView setAnimationDelay:0.25];
    [UIView setAnimationDuration: kAnimationDuration];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
    optionsView.frame = frame;
    [UIView commitAnimations];
}
lucius
It depends on if he wants to have the subview covering the current content or not. Your method would cover the original content, while using a scroll view would push up the original content.
Simon