Search code examples
iphoneiosios7rubymotionios6.1

Button behaving differently in 6.1 vs. 7.0


I have the following code to show a simple button:

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)

When I run this app in simulator iPhone retina (3.5 inch) with 6.1 it looks like this:

enter image description here

However, when I run it in simulator iPhone retina with 7.0 it looks like this:

enter image description here

Does this code need to change to work well with 7.0?


Solution

  • As of iOS 7 the default rounded rectangle button looks like this. See the UI transition guide. I suggest using custom buttons to prevent such discrepancies between versions.