使用iOS7构建可生成iOS6外观小部件 [英] Building with iOS7 produces iOS6 looking widgets

查看:137
本文介绍了使用iOS7构建可生成iOS6外观小部件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在迁移到XCode 5和iOS7基础SDK之后,我的应用程序中的一些UI小部件在iOS7设备上仍然看起来像iOS6风格(渐变,框架)。这不会发生在iOS7的等效仿真器上。对于所有小部件也不会发生这种情况,UIDocumentInteractionController的弹出窗口在设备上看起来像iOS7,但UIPopoverController却没有。用于重命名文件的键盘还显示了仿真器和设备之间的差异。

After moving to XCode 5 and the iOS7 base SDK, some of the UI widgets in my app still look like iOS6-style (gradients, frames) on iOS7 devices. This doesn't happen on the equivalent emulator for iOS7. This also doesn't happen for all widgets, UIDocumentInteractionController's popup looks like iOS7 on device, but UIPopoverController doesn't. The keyboard for renaming a file also shows this discrepancy between emulator and device.

iOS如何确定UI元素的视觉风格?它是基于静态链接的库还是在运行时确定的东西?我已经尝试完全从设备中清除应用程序,但没有任何变化。

How does iOS determine the visual style of UI elements? Is it based on a statically linked library or something determined at runtime? I've tried purging the app from the device completely, but no change.

视网膜iPad模拟器: UIPopoverController

Emulator for retina iPad: UIPopoverController

iOS 7的iPad第三代: UIPopoverController

iPad 3rd gen with iOS 7: UIPopoverController

这种情况下的代码相当简单,没有自定义渲染或布局。

The code in this case is fairly straightforward, no customization of the rendering or layout.

self.poController = [[UIPopoverController alloc] initWithContentViewController:audioCopyController];
[audioCopyController showDoneButton:NO];
audioCopyController.view.frame = CGRectMake(0,0,350,250);
_poController.popoverContentSize = audioCopyController.view.bounds.size;
_poController.delegate = self;
[_poController presentPopoverFromRect:view.audiocopyButton.frame
                                           inView:view
                         permittedArrowDirections:UIPopoverArrowDirectionDown
                                         animated:YES];

感谢您提前获得帮助。

推荐答案

好的,我发现了问题所在。大卫的建议让我思考。

Ok, I found out what the problem was. David's suggestion got me thinking.

我同时维护多个应用程序,其中一个很老。 XCode5中的新界面构建器破坏了旧应用程序中许多字段的透明度,因此我将XCode4保存在XCode5旁边的单独安装文件夹中。似乎我的XCode5项目仍然指向XCode4的SDK文件夹(不确定这是怎么可能的,查看实际的链接器命令行可能会有所帮助),所以在从我的机器上删除XCode4的6.1 SDK文件夹之后,使用XCode 5进行干净的构建,在iOS支持的应用程序中生成了正确的iOS 7外观小部件。

I am maintaining multiple apps at the same time, and one of them is quite old. The new Interface Builder in XCode5 breaks the transparency for a lot of the fields in the old app so I was keeping XCode4 in a separate installation folder alongside of XCode5. It seems that somehow my XCode5 project was still pointing at the SDK folders of XCode4 (not sure how this was possible, looking at the actual linker command line would probably shed some light), so after deleting XCode4's 6.1 SDK folder from my machine, a clean build with XCode 5 produced the correct iOS 7-looking widgets in my iOS-supported app.

故事的寓意是,对多个XCode / SDK非常小心安装在同一台机器上。希望这可以帮助其他人尝试类似的东西来为旧版应用程序提供支持。

The moral of the story is, be very careful with multiple XCode/SDK installations on the same machine. Hopefully this can help other folks who may be trying something similar to provide support for legacy apps.

这篇关于使用iOS7构建可生成iOS6外观小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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