iPad SplitViewController奇怪的行为 [英] iPad SplitViewController Strange Behaviour

查看:114
本文介绍了iPad SplitViewController奇怪的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用SplitViewController的应用程序。当我启动应用程序并将设备(或模拟器)保持在纵向模式时,第一次出现DetailView时,它不显示弹出按钮,而如果我在横向模式下转动iPad,则返回到纵向,按钮显示正确。
我一直在搜索,我发现在第一次启动时我应该显示按钮的工具栏是空的。

I have an Application that uses SplitViewController. When I launch the App and keep the device (or the Simulator) in Portrait Mode, the first time the "DetailView" appears, it doesn't show the popover button, while if I turn the iPad in Landscape Mode, then back to Portrait, the button shows itself correctly. I've searched around and I discovered that the toolbar where I should present the button is null at the time of first launch.

我该怎么办?

推荐答案

在将窗口设置为[self.window makeKeyAndVisible];之前,必须在代码中设置委托,因此要么链接接口构建器中的委托或者只是在应用程序中显示窗口之前调用它就完成了启动方法。

You must set the delegate in your code before you set the window to [self.window makeKeyAndVisible];, so either link the delegate in interface builder or simply call it before you present the window in your application did finish launching method.

这篇关于iPad SplitViewController奇怪的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆