
This behavior is another giveaway that your app isn't native, and it's rarely the behavior you want in a native app. To stop this behavior, capture touchmove events on the document in JavaScript and cancel them. The iPhone automatically applies the glossy finish. On older iPhones, which used 56x56 icons, and the iPad, which uses 72x72 icons, the graphic automatically scales down. If you don't want the glossy finish applied automatically, use apple-touch-icon-precomposed instead of apple-touch-icon. The file must be exactly 320x460, or else the iPhone ignores it. Make sure your web server serves up .manifest files with the MIME type text/cache-manifest, or else this won't work. And then check using wget -S that the content type in the response headers is correct. If you find your app suddenly stopped working when you started using a cache manifest, make sure every URL you use is in the right section. When a cache manifest is in use, the app launches with the last version of the files. It pulls a new version of the manifest in the background if network connectivity is available, and on the next launch you'll see the new version if the manifest has changed.
I recommend renaming the manifest file so that it 404s during iterative development. You can capture multi-touch and gesture events in JavaScript. If you just want to use touching in place of clicking, then the target field of the event object contains the element that was touched. I created an example app that uses gestures to scale a graph. There's also a great write-up of touch and gesture events in JavaScript, if you want to provide deeper multi-touch support. For more code and a second JavaScript app that uses gestures heavily, see my second iPhone app post: a multitouch remote control for a robot. If you want to take an action when the phone is rotated, listen for onorientationchange events on the body tag. The current orientation is in window.orientation, and it is encoded as the angle (in degrees) that the iPhone is rotated--0, -90 or 90--away from vertically upright. I created the iPhone-like background for my logging app with a background-image for the document body.
0 Comments