开发者

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

开发者 https://www.devze.com 2023-01-04 16:42 出处:网络
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 Face

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

精彩评论

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

关注公众号