开发者

Slide up UIView

Hi i want to slide up by button click an anothet UIView over the original, and after user click on a back button a want to come back to original UIView. Like notofikations view in facebook app, or showing the phot开发者_JAVA技巧o library from camera app.

How can I realize this?


The method you are looking for is found in UIViewController. In your view controller just do something like this:

[self presentModalViewController:viewControllerOfViewToSlideUp animated:YES];


This is what you use view controllers for. The standard view controllers have built in methods to do this transition. If you want to do it manually, you can tell your current view controller to invoke a new view controller via the presentModalViewController:animated: method.

If you don't want to use view controllers, you can just position a new view below the bottom of the current view and then use Core Animation to move it into position. The easiest way would be something like this:

[[view animator] setFrame:position];

But the proper way to do it is with a view controller.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜