himan
himan

Reputation: 459

Story Board issue after upgrading to Xcode 5 and ios 7

I could not figure out why this is happening.I searched here but could not find any answer for this. The problem is I developed some screens using StoryBoard in xcode 4 and ios 6 but now I upgraded to xcode 5 and ios 7.But after upgrading all my labels,text fields have changed dimensions.Their x,y co-ordinates have changed along with width and height.They all have same x,y co-ordinates(0,758) and width,height as 0,0. I can bring them back manually editing but there are too many fields to do so. Is there anyway to do it easily?

Upvotes: 2

Views: 748

Answers (1)

Tommie C.
Tommie C.

Reputation: 13181

Recommendation

From your problem description it sounds like you're seeing the effects of the deep system changes in iOS7.

To verify that you are not seeing any bugs please select your storyboard or xib file (this works on both) and open the assistant editor.

Next choose the Preview as the assistant editor. This will show you the storyboard layout as it will look on your device.

Note the menu on the lower right will show three things:

  • The version of iOS being previewed
  • A rotation control to show the controls in different orientations
  • A height control to show how the view will look at 3.5/4.0 heights

iOS7 Preview

iOS7

iOS6 Preview

iOS6

Please keep in mind that the iOS7 control sizes are different from all other prior versions of iOS so they will never line up precisely. Use of auto layout will need to be re-examined if your app is highly complex: There are two options: Review the auto layout guide (here) or turn it off (in the file attributes inspector) and use the old springs and struts (autosizing).

I recommend a thorough reading of Apple's transition guide (link) to make sure you understand the impact of the changes to the UI controls.

Techtopia has a good article on iOS7 Auto Layout which can be very useful in managing the sizing and appearance of UI Controls (link).

Apple has a sample app that I think is worth examining called UICatalog (link). I recommend downloading the app and running it on your simulator to see how the new controls will look. Note that the sample does not have auto layout constraints active, if you choose to continue using auto layout you may want to consider defining your layout with the Visual Formatting Language (link).

Other things to consider

  • There were some bugs with the early build of storyboard in Xcode 5 and auto layout was changed significantly, please make sure you download the absolute latest version of Xcode.

  • You could try cut and paste the objects in Xcode.

  • You should verify that the auto layout setting is consistent between versions (either on/off in the file inspector).

  • Check that your auto layout constraints are not generating a warning or error in Xcode. If they are you will need to Update All Constraints.

  • Make sure you have git turned on before starting so you can rollback your changes to a known state.

Hope some of these suggestions will be helpful.

Upvotes: 2

Related Questions