开发者

How to have a UIView appear from the middle of the screen

I looked at Apple's UIModalTransitionStyle开发者_开发技巧, but didn't see what I was looking for. I want to do the same thing that the Facebook iPhone App does; when you touch on a button on the Facebook's homescreen, the new UIView appears (and then disappears when you are done) from the middle of the screen. I would like to implement similar transitions in my iPhone app, and I was wondering if there was a quick way to do it (already precoded), and if not, how would I code it so I can do the same thing?

Edit: To clarify, the transition should have the UIView grow out of the middle of the screen, and then it fills up the entire view. When the user dismisses the view, the view shrinks into the middle of the screen, getting smaller until it has disappeared. Just like in the Facebook app.

Thank you!


myView.center = parentView.center

where myView is your new UIView that is appearing and parentView is the view that holds the button or else you could reference the application's window.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜