如何让 UIView 从屏幕中间出现
我查看了苹果的 UIModalTransitionStyle,但没有看到我要找的东西。我想做 Facebook iPhone 应用程序所做的同样的事情;当您触摸 Facebook 主屏幕上的按钮时,新的 UIView 会从屏幕的中间出现(完成后消失)。我想在我的 iPhone 应用程序中实现类似的转换,我想知道是否有一种快速的方法可以做到这一点(已经预编码),如果没有,我将如何编码以便我可以做同样的事情?
编辑:为了澄清,过渡应该让 UIView 从屏幕中间伸出,然后填充整个视图。当用户关闭视图时,视图会缩小到屏幕中间,逐渐变小直至消失。就像在 Facebook 应用程序中一样。
谢谢你!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
其中 myView 是出现的新 UIView,parentView 是保存按钮的视图,否则您可以引用应用程序的窗口。
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.