There’s a tonne of talk about the double-resolution screen that’s rumoured to be coming in the iPhone “HD”: and over the past couple of weeks I’ve been spending a little time thinking about how that affects Happening. I haven’t fully finished the work to prepare the application for the higher resolution screens, but here’s some hints from a relative newbie to help point people in the right direction. These tips aren’t just aimed at any potential resolution-doubling - I don’t after all know what Apple’s plans are for the next iPhone - they’re just good practice.
In Happening 1.0, the hue of the navigation bar was a rather bold red. It fitted the original icon, and was entirely set via setTintColor:.
For 1.1 the icon changed and as a result I changed the gradient of the navigation bar to match. The gradient isn’t the standard Apple gloss (setting the standard Apple gloss looked, frankly, terrible) so instead I use a category on the UINavigationBar to set the background image. Whilst this allowed me to set the gradient quickly and easily, a PNG background image isn’t going to scale nicely. So in the next update to Happening, instead of simply setting an image background via the category’s drawRect: method, I actually draw the gradient in code - thus avoiding the resolution dependence.
Lesson: draw in code where possible [or at the very least, use vector graphics]
For 1.0, the loading HUD was a fixed pixel size (150 pixels square), with a window-size-relative. Whilst the latter was a good first-step, the fixed pixel size wouldn’t scale appropriately.
Lesson: Don’t use fixed-pixel sizes. And if you’re going to go pixel-independent, go the whole hog: take the time and do it right.
As Happening is a fairly standard iPhone app, there’s not a large amount of custom drawing to re-think: however a couple of things (including this little item) remain on my hit-list of things to keep an eye on, post-WWDC. Even if you’re unsure what else needs changing right now, those PNG icons should probably be your first port of call and Tim’s article on what 320dpi means for designers should be your second as you await Steve Jobs’ WWDC Keynote next week.
Sidenote: The changes I’ve already made to Happening are entirely behind the scenes - hell, for all the two evening’s changes I made to ensure the application wasn’t using fixed-pixel values, not a single value used has changed - and some folks may now find it hard to justify checking these things as they push for iPhone 4.0 submission dates. But a little time spent going back over the Happening codebase to free myself of fixed-pixel images and values provided a welcome opportunity to revisit and tidy up the code surround the drawing - and that’s always a good thing.
Posted on Wednesday June 2nd, 2010
© Nik Fletcher 2007-2011 ~ Contact