简体   繁体   中英

UITableViewController with a UIPickerView sliding up the screen

I have a UITableView where a cell needs to be filled in with a date by selecting it through a pickerview. Instead of pushing the pickerview onto the navigationController I would want to let it slide up halfway into the screen with the tableview still visible in the upper half of the screen. I've seen some apps doing this neat effect before but I don't see on how to accomplish this.

Anyone some helpful hints on this ?

I did this a little while back and asked about it .

I ended up doing exactly what the highest voted answer says: Put the UIPickerView in the same View as your other items and animate the sliding motion using UIView's beginanimation method.

Add a done button in your tool bar. Add a new target/action to the button to call a method on the UIViewController that has your table view and picker controller. Then have it animate the view back off the screen using a UIView animation block.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM