iPhone iPad UIView 控制器弹出窗口居中
我的应用程序适用于 iPad。
我有一个 UIViewController 作为我的应用程序的主视图。 我在底部有一个 UIView 作为页脚,里面有 3 个 UIView (子视图)。
我的页脚横幅中的 3 个子视图为每个不同的 UIViewController 加载,并将该控制器的视图显示到它们的视图中。
我希望当我单击此子视图之一的按钮(属于我的 UIViewController 的按钮,具有 240x162px 视图)时,使子视图消失并在我的主视图中显示带有动画的居中弹出窗口(500x350px)。
举个例子,iPad 版的 WeatherBug 具有我想要的功能,当您单击顶部的块时,会完成小视图翻转和缩放效果,从而显示一个包含更多内容的居中 uiview。
请告诉我应该去哪里寻找! 谢谢你,
My application is for iPad.
I have a UIViewController as the main view of my application.
I have an UIView at the bottom as a footer, and inside 3 UIView (subviews).
My 3 subviews in the footer banner load for each a different UIViewController and display the view of this controller into their view.
I would like when I click on a button into one of this subview (button that belongs to my UIViewController, with a 240x162px view), to make the subview disappear and display a centered popup (500x350px) with an animation into my main view.
To show you an example, WeatherBug for iPad has what I want, when you click on a block on top, the little view flip and a zoom effect is done, that display a centered uiview with more content.
Please tell me where I should look for!
Thank you,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用委托模式。将“根”视图控制器指定为“页脚”视图控制器的委托。当点击按钮时(在 iPhone 上不要点击),“页脚”视图控制器将隐藏横幅,然后调用委托方法来处理点击操作;在这种情况下,“根”视图控制器将显示居中的弹出窗口。弹出窗口完成后,“根”视图控制器会告诉“页脚”视图控制器再次显示横幅并恢复正常。
Use the delegate pattern. Assign your "root" view controller as the delegate for your "footer" view controller. When the button is tapped (no clicking on the iPhone), the "footer" view controller will hide the banner, then call a delegate method to handle the tap action; in this case, the "root" view controller then shows your centered popup. When the popup is done, the "root" view controller then tells the "footer" view controller go show the banner again and go back to normal.