read

Apple has now decreed that all apps submitted to the store must be built on XCode5 and iOS7.

And so it shall be…

So I’ve started building our Xamarin iPhone project against said platforms. Now there is a lot of redesign that should go on with moving to iOS 7, but to tell you the truth we went for a pretty flat design to begin with, so the first port of call is just migrating straight across and getting certified as an iOS 7 app.  Once we have that done, we can spend time taking advantage of more iOS 7 features

 

MjAxMy03NDY3YWM2NzFlNzdkYTgw

 

The transition has been surprisingly smooth and there have only been a few issues (so far).

1. Content disappearing behind Navigation Bar

I found in some places the content of my views were being pushed up underneath the navigation bar.   This is because in iOS 7 view controllers use full screen layout.  In my case I wasn’t going to redesign the UI at this point to handle things differently so to get around this I just set the value for EdgesForExtendedLayout to None in the ViewDidLoad of the UIViewControllers, like so:

[syntax type=”html|php|js|css”]

public override void ViewDidLoad()
{
EdgesForExtendedLayout = UIRectEdge.None;

base.ViewDidLoad();

}[/syntax]

There is more information available on the Apple iOS 7 UI Transition Guide.

 

2. Button Labels being trimmed with ellipsis (…)

Now that buttons are so cool they don’t need chrome or borders anymore I noticed that I was getting some trimming of text happening on button labels. Like this:

Search-Ellipses

After much slapping of forehead I discovered that the cause was that I was setting the UILabel.Appearance.Font property in theAppDelegate’s FinishedLaunching .  This global change was enough for iOS 7 to think that C…cel looked much better than Cancel.  Get rid of that and viola, iOS 7 is happy because it has full control again 😉

Search-Nice

3. Your UISwitch custom background images are gone!

Those pretty custom backgrounds you created for your UISwitch are no longer functional.  Not a biggy really, however, I also noticed that if your BackgroundColor of your UISwitch is set to UIColor.Clear you get a nice “Googely Eye” effect when you toggle your buttons.

UIToggle

Is it on, is it off… who can tell.  Anyway, looks like it’s time to bow down to iOS and let it run the show. So get rid of your UIColor.Clear!

 

I’ll let you know of any more issues I have as I do a basic port to iOS 7.  Till then anyone else got any other war stories they want to share?

 

 

Kym

Mobile, Xamarin, Windows Store Apps, Agile -- I love 'em all! Check out more


Published on

Show Comments
  1. Mike Irving says:

    No way.. I didn’t know about EdgesForExtendedLayout, but I’ll be sure to try it out.

    Check out my blog “Adapting Apps for iOS 7” in which I explore the iOS 6/7 Deltas in the Interface Builder, and look at doing thing programmatically, based on iOS Version, in Xamarin.

    http://www.mike-irving.co.uk/web-design-blog/?blogid=78

    Mike.

    1. Hi Mike, Thanks for sharing your blog. I’ll check it out.

      I notice down the bottom of your blog post you mention getting the iOS version number in Xamarin by querying UIDevice.CurrentDevice.SystemVersion property and spliting to get the major number…

      I think you could also do it by calling UIDevice.CurrentDevice.CheckSystemVersion(7,0) which will return true if the version is > 7.0. check here: http://blog.xamarin.com/ios-6-7-compatibility-tips/

      I know this because you need to check the version number before setting EdgesForExtendedLayout otherwise it’ll blow up in iOS6, so basically I do this:

      if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0))
      EdgesForExtendedLayout = UIRectEdge.None;

      Cheers,
      Kym


Leave a Reply

Your email address will not be published. Required fields are marked *

Kym Phillpotts

I write about Xamarin Forms, mobile development or whatever else I might be concentrating on.

Back to Home