How can I animate displaying UIPickerView after pressing button?

后端 未结 6 1315
日久生厌
日久生厌 2021-02-03 13:38

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

6条回答
  •  感情败类
    2021-02-03 13:44

    You can create a viewcontroller and then add the UIPickerView inside the controller and then use:

    [self presentModalViewController:viewControllerWithPickerView animated:YES];

    or you can add your UIPickerView not hidden but with a y value bigger than the screen, like 480.0 or bigger and then use UIView animations to move the UIPickerView from that position to a position visible on the screen, that would emulate the ModalViewController animation.

提交回复
热议问题