iOs特定于设备的资源不起作用 - ~iPad加载默认XIB - 通用应用程序 [英] iOs device-specific resources not working - ~iPad loading default XIB - universal app

查看:146
本文介绍了iOs特定于设备的资源不起作用 - ~iPad加载默认XIB - 通用应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个基于Utility App模板的通用应用程序。我选择了一个通用应用程序,MainView.xib和MainView~iPad.xib在两种设备类型上都能正常工作。

I'm making a universal app based on the Utility App template. I've selected a universal app and the MainView.xib and MainView~iPad.xib work properly on both device types.

在iPad2上,当我切换到FlipsideView时,它会加载FlipsideView.xib,即使项目中有一个非常好的FlipsideView~iPad.xib文件。默认的xib是正常的(iPhone)大小并显示在iPad的左下角。

On the iPad2, when I switch to the FlipsideView, it loads FlipsideView.xib even though there is a perfectly good FlipsideView~iPad.xib file in the project. The default xib is normal (iPhone) sized and displaying in the lower left hand corner of the iPad.

我必须手动创建FlipsideView~iPad xib。我相信我已经在IB中正确连接了xib,因为它显示与FlipsideView.xib连接相同。

I did have to create the FlipsideView~iPad xib manually. I believe I have the xib properly wired in IB as it shows identical to the FlipsideView.xib connections.

在过去的几周里,我读了很多类似问题的帖子,并且这个Stack Overflow线程回答得最清楚,并包含Apple文档的链接。所以我知道它适用于其他人并且有记录。

Over the last couple weeks, I've read quite a few posts with similar problems and this Stack Overflow thread answers most clearly and contains links to Apple documentation. So I know it works for others and is documented.

此部分的代码与库存效用应用程序模板中的showInfo()方法相同。

The code for this section is identical to the showInfo() method in the stock Utility App template.

(是的,我知道我可以手动加载~iPad版本检查UI_USER_INTERFACE_IDIOM()。我正在试图弄清楚我在做什么错误让~iPad修饰符起作用。 )

(Yes I realize I can manually load the ~iPad version checking UI_USER_INTERFACE_IDIOM(). I'm trying to figure out what I'm doing wrong in getting the ~iPad modifier to work.)

我缺少什么想法?

非常感谢您的帮助!

推荐答案

最后我找到了解决方案。这真的很简单。
xib必须命名为~ipad而不是~iPad,而@ iphone而不是~iPhone。
糟糕的是,如果你给它们命名~iPad,一切都在模拟器中工作,但它在真实设备上不起作用。

in the end i found the solution. it is really very very simple. The xib must be named ~ipad instead of ~iPad, and ~iphone instead of ~iPhone. The bad thing is the if you name them ~iPad, everything works in the simulator but it does not work on the real device.

这篇关于iOs特定于设备的资源不起作用 - ~iPad加载默认XIB - 通用应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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