|
OK OK, so I admit I'm already running version 1.1.3 of the iPhone firmware. While I think it's fantastic that I now get the ability to add web icons to the home screen, and that the home screen has multiple pages, I usually spend my first few minutes on a new version of the firmware looking for changes in Safari that might impact iPhone web application developers.
One that I noticed right away is that Safari is no longer fooled by the 1-pixel scroll trick. In case you're not familiar with this trick, the way it worked is that under previous versions of the iPhone software, if you scrolled the web page slightly, then the address bar would hide itself. iPhone web application developers took advantage of this to make their applications look a little more "native" by using JavaScript to simulate a user scroll of just one pixel.
What I've noticed on the new 1.1.3 firmware is that Safari no longer auto-hides the address bar when you're scrolling... which means that web applications now look a little less "native" than they used to, especially if they were designed to fit exactly into the space on the iPhone screen _without_ the presence of the address bar. Apps like Gmail no longer cut "just right" on the fold and you can actually see some of these app "twitch" a little when the code that previously caused the address bar to hide is executed.
If you want my personal opinion on this, I'm thinking that this move is designed deliberately to make sure that people know the difference between web applications and native applications - the presence of the Safari address bar. Without that, it becomes really, really hard to tell whether you're on a web app or a local native app. This difference is trivial at the moment because the list of "legal" (e.g. non-hack-created) iPhone native applications is finite and well-known. Once the SDK comes out in "late" (I'm guessing Feb 29th) February, we're going to see a lot of applications that we've never seen before, and users will need to know whether they're looking at a web app or a native app.
That said, I've done some more experimenting and there are places where Gmail _does_ successfully scroll down past the address bar... but the address bar used to visibly animate itself away, which it doesn't seem to do anymore... Who knows, I could be on crack and nothing has changed w/Safari at all...
I use that method on a couple pages on iphav.com and I just updated to
1.1.3 and don't see the problem. It scrolls just like it always has.
Well, there's a good chance the ObjC/C# book won't get published...or if it
does, it'll be by a different author. I've been experimenting with
different pages and with my own code, it seems to be unaffected. The
largest problem is evident on Gmail, so I'm wondering if it isn't just some
weirdness in their code that I assumed was showing up everywhere.
I want to learn how to do that scroll down 1pixel to hide the address bar.
How do I do that??
You make your body tag look like this:
<body onload="initScreen()"
onorientationchange="updateOrientation()">
initScreen();
i just used @Dave Martin's example and it works just fine on 1.1.3 (link
via my name)
Yeah, the trick still works... Apparently when I wrote this blog entry, I
was just looking at google and gmail and both of them were having
ridiculous problems with iPhone rendering. In fact, I've been noticing that
gmail performance and reliability has been in the crapper lately and that
is likely the cause of the problem. I've tried the trick Dave mentions and
other variations on it and they all seem to still work on 1.1.3.