I want to animate my UIPickerView after pressing the button. I already have coded my UIPickerView to be hidden on viewDidLoad and not hidden after pressing a button, but it does
You can use the following code for animating the picker view after pressing the button:
-(IBAction)button:(id)sender
{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.6];
CGAffineTransform transfrom = CGAffineTransformMakeTranslation(0, 200);
PickerView.transform = transfrom;
PickerView.alpha = PickerView.alpha * (-1) + 1;
[UIView commitAnimations];
}
Don't forget to add the following code to your viewDidLoad method
PickerView.alpha = 0;
[self.view addSubview:PickerView];
What it does is it makes the picker view fall from the top of the screen on 1st click and to make the picker view disappear,you can simply click the button again.From the next click the picker view just appears and vanishes..Hope it helps and works :)