0

After I perform the slide method, the buttons on the UIView stop working after the method is called.

Any thoughts on what may be happening?

@implementation ResultSliderView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        self.frame = CGRectMake(10,255,0,0);

    }
    return self;
}

/*
This method slides the view up by animating
*/
-(void)slideUp{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:.5];
    [UIView setAnimationCurve:UIViewAnimationOptionAllowUserInteraction];
    self.frame = CGRectMake(5,38,0,0);
    [UIView commitAnimations];
}
William Falcon
  • 9,813
  • 14
  • 67
  • 110

1 Answers1

1

Your view has zero size, so the buttons will be outside its frame -- they don't receive touches when they're outside the frame (if your view doesn't have clip subviews set, you'll still see the buttons though).

rdelmar
  • 103,982
  • 12
  • 207
  • 218
  • Genius. Any chance you would also know how to allow the user to drag the view as opposed to just setting it myself? so like a slider, if I drag, it follows, but if I go more than halfway up and let go, it snaps to the top, otherwise to the bottom? – William Falcon Mar 23 '13 at 19:29
  • 1
    @waf, to do that, you would attach a pan gesture recognizer to the view, and change the frame using its translationInView property to follow the movement. – rdelmar Mar 23 '13 at 20:37