简体   繁体   English

UIButton在iOS 7中的兼容模式下无法获得iOS 6样式

[英]UIButton doesn't get iOS 6 styling in compatibility mode in iOS 7

I am working on an app that has not yet been redesigned for iOS 7. There are a few new features being added that I want to deliver in an app update, but I want the app to run in iOS 6 "compatibility mode" on iOS 7. I have set the Base SDK to iOS 6.1. 我正在开发尚未针对iOS 7重新设计的应用程序。我想在应用程序更新中添加一些新功能,但是我希望该应用程序在iOS 6上以iOS 6“兼容模式”运行7.我已将基本SDK设置为iOS 6.1。 When I build and run everything looks fine in the iOS 6 Simulator. 当我构建和运行时,iOS 6 Simulator中的一切看起来都很好。 However, in the iOS 7 Simulator, all elements look iOS 6-ish with the exception of the UIButtons which are all borderless. 但是,在iOS 7 Simulator中,除了UIButtons都是无边界的以外,所有元素看上去都与iOS 6相似。

Is this expected behavior, or am I doing something wrong? 这是预期的行为,还是我做错了什么?

I tested this using a simple app with one button and one switch. 我使用一个带有一个按钮和一个开关的简单应用程序进行了测试。

iOS 6 Simulator: iOS 6模拟器:

iOS 6

iOS 7 Simulator: iOS 7模拟器:

IOS 7

Notice how the switch remains iOS 6-like in iOS 7 but the button does not. 请注意,该开关在iOS 7中如何保持类似于iOS 6的功能,但是按钮却没有。

From my experience you need to work and submit the app using xCode 4.6 if you want to retain the iOS 6 UI. 根据我的经验,如果要保留iOS 6 UI,则需要使用xCode 4.6进行工作并提交应用程序。 Testing is a little tedious in iOS 7 but you can do it but installing the ad hoc app on your iOS 7 device. 在iOS 7中进行测试有点乏味,但是您可以执行此操作,但可以在iOS 7设备上安装即席应用程序。

Update 更新资料

as @rmaddy mentions in the comments, you can build directly from Xcode 4.6 to iOS 7. Use your iOS 7 device with xCode 5 before doing so. 正如@rmaddy在评论中提到的那样,您可以直接从Xcode 4.6到iOS 7进行构建。在此之前,请将iOS 7设备与xCode 5配合使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM