iphone - 按钮在 6.1 和 7.0 中的行为不同

标签 iphone ios ios7 rubymotion ios6.1

我有以下代码来显示一个简单的按钮:

button = UIButton.buttonWithType(UIButtonTypeRoundedRect)
button.center = CGPointZero
button.frame = [[container.width/2-button.frame.size.width/2,150], [280,50]]
button.setTitle("Categorize New Project", forState: UIControlStateNormal)
button.addTarget(self, 
                 action: "moveToChildView:",
                 forControlEvents: UIControlEventTouchUpInside)

当我在模拟器 iPhone 视网膜(3.5 英寸)6.1 中运行这个应用程序时,它看起来像这样:

enter image description here

但是,当我在模拟器 iPhone retina 7.0 中运行它时,它看起来像这样:

enter image description here

此代码是否需要更改才能在 7.0 中正常工作?

最佳答案

从 iOS 7 开始,默认的圆角矩形按钮看起来像这样。查看UI transition guide .我建议使用自定义按钮来防止版本之间出现此类差异。

关于iphone - 按钮在 6.1 和 7.0 中的行为不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19451131/

相关文章:

ios7 - 搜索栏同时显示 "e"和 "é"的结果

ios - 手动设置 UIButton 状态

iphone - iOS TableView 崩溃加载不同的数据

ios - 通过多个按钮播放多个音频文件

iPhone : Hiding/showing Toolbar

ios - 归档我的项目时,“无法导入桥接头”, 'file not found'

ios - 我们可以从 iOS 6 OTA 升级到 iOS 7 吗?使用过的数据被删除了吗?

iphone - iOS 7 UIButton 的 Voiceover 问题

ios - 在现有项目中添加/引用其他项目

iphone - 在特定时间间隔内重复报警