The World’s Leading Microsoft .NET Magazine
   
 
The .NET Addict's Blog

My Top Tags

                                                           

My RSS Feeds








Latest Diggs - Programming

Internet Blogs - Blog Top Sites

Site Hits

Total: 2,502,482
since: 19 Jan 2005

1-Pixel Scroll Trick no longer hides Safari Address Bar on iPhone v1.1.3

posted Tue 15 Jan 08

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... 

tags:          

links: digg this    del.icio.us    technorati    reddit




1. Dave Martin left...
Tue 15 Jan 08 7:36 pm :: http://iphav.com

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.

Love your blog by the way. I can't wait for the Obj-C/C# book, too.


2. Kevin Hoffman left...
Tue 15 Jan 08 7:50 pm

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.


3. Charlie left...
Fri 22 Feb 08 4:45 pm

I want to learn how to do that scroll down 1pixel to hide the address bar. How do I do that??


4. Dave Martin left...
Thu 28 Feb 08 1:33 pm :: http://iphav.com

You make your body tag look like this: <body onload="initScreen()" onorientationchange="updateOrientation()">

And make those functions look like this: function initScreen() { setTimeout("window.scrollTo(0,1);",100); } function updateOrientation() {

  • initScreen();

}

Many more of those tricks found here http://groupaware.mobi/iphoney/


5. oneighturbo left...
Mon 03 Mar 08 12:15 am :: http://m.oneighturbo.com/alms/

i just used @Dave Martin's example and it works just fine on 1.1.3 (link via my name)


6. Kevin Hoffman left...
Mon 03 Mar 08 9:08 am

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.


Tag Related Posts

MobileMe vs. Live Mesh Throwdown - Round 1

Wed 16 Jul 08 10:33 A GMT-05

Building Model Classes in C# and Cocoa

Sun 15 Jun 08 3:13 P GMT-05
tags:            

MobileMe vs. Live Mesh - Round 1

Wed 11 Jun 08 12:20 A GMT-05

My Macbook Air is masculine, dammit!

Mon 17 Mar 08 6:59 P GMT-05
tags:          

iPhone Developer Summit

Sun 16 Mar 08 8:39 P GMT-05

iPhone Underrated as a Gaming Device?

Fri 14 Mar 08 1:50 P GMT-05
tags:        

My take on the iPhone SDK

Sat 08 Mar 08 1:39 P GMT-05

Jobs says "not likely" to Flash on the iPhone

Thu 06 Mar 08 1:39 A GMT-05
tags:          

My Macbook Air Review

Sun 02 Mar 08 4:20 P GMT-05

iPhone Roadmap March 6th

Fri 29 Feb 08 10:41 P GMT-05
tags:        

Video of the Macbook Air in Action

Wed 20 Feb 08 3:04 P GMT-05

Macbook Airはきれいですよ!

Sun 17 Feb 08 2:38 A GMT-05

Why is O'Reilly Condoning iPhone Hacking?

Mon 11 Feb 08 3:55 P GMT-05

Evaluating my next laptop purchase

Wed 06 Feb 08 8:40 P GMT-05

The iPhone SDK key has been leaked! Oh Noez!!!1

Tue 29 Jan 08 11:36 A GMT-05
tags:        

Why Geeks just don't "get" the Macbook Air

Thu 17 Jan 08 2:30 P GMT-05

Popcorn + TiVo + Macbook Pro + iPhone == Hell Yeah!

Tue 15 Jan 08 3:11 P GMT-05
tags:          

How my ADC membership changed my life

Mon 31 Dec 07 3:57 P GMT-05
tags:      

Leopard Code Sample : Sprinkling in some Bonjour

Tue 27 Nov 07 2:32 P GMT-05
tags:        

Celebrity Death Match: iPhone vs. gPhone

Tue 06 Nov 07 1:52 A GMT-05
tags:    

Leopard Sample: A Bound NSCollectionView

Mon 29 Oct 07 1:41 A GMT-05

Leopard is out - let the code samples begin!

Fri 26 Oct 07 10:09 A GMT-05
tags:          

My life is complete : iPhone SDK is CONFIRMED.

Wed 17 Oct 07 6:38 P GMT-05
tags:          

Leopard Shipping October 26th!!

Tue 16 Oct 07 4:59 P GMT-05
tags:        

Editorial : My thoughts on iPhone Hacking

Tue 25 Sep 07 6:10 P GMT-05
tags:      

$4800 iPhone Bill for International Data Roaming

Mon 10 Sep 07 1:15 P GMT-05
tags:    

iPhone Apps are now also iPod Touch Apps

Sat 08 Sep 07 7:33 P GMT-05
tags:    

Using the iPhone Keyboard

Fri 31 Aug 07 2:08 P GMT-05
tags:      

Meebo on my iPhone - a useable IM client!

Tue 24 Jul 07 2:56 P GMT-05
tags:    

My iPhone Review

Mon 23 Jul 07 1:09 P GMT-05
tags:        

Wil Shipley Discusses the lack of iPhone SDK

Mon 09 Jul 07 1:50 P GMT-05
tags:    

OMFGWTF iPhonez0rz!!1!one!!

Fri 29 Jun 07 5:45 P GMT-05
tags:  

Microsoft Codename Acropolis - Unwrapped

Wed 20 Jun 07 3:22 P GMT-05
tags:              

Exploring the Delegate Design Pattern

Mon 14 May 07 6:30 P GMT-05

Core Data - Almost too Easy?

Wed 18 Apr 07 2:23 P GMT-05

An experience with the Leopard beta

Mon 26 Mar 07 7:45 P GMT-05
tags:                

WPF Bindings == WTF Bindings?

Mon 12 Mar 07 6:31 P GMT-05

Objective-C 2.0 - Programming for wimps?

Wed 31 Jan 07 6:18 P GMT-05
tags:              

Mac OS X Leopard Developer Preview

Tue 09 Jan 07 1:58 P GMT-05
tags:      

Is the continuous beta the new model for Vista?

Tue 21 Nov 06 8:51 P GMT-05
tags: