i am creating a web page for iphone, i need the page to display efficiently in the iphone as well as on pc's. I'm coding in xhtml and uses support of JavaScript and css. The problem is that, i'm getting the correct view in the pc's but too small in the phone.how to adjust the size of the page. I am checking the user agent and loading a separate page (other than one for the pc) for the iphone. But i dont know hat changes are to be made to the attributes of body, inputs and other things so as to enable it to view correctly on the mobile browsers also
Are you making the same page for both devices? Usual practice is to make two separate pages that are optimised for both devices which by their nature have different form actors and characteristics.
so code along the lines of
$browser = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
if ($browser == true) { header('Location: http://www.yoursite.com/iphone/'); }
//else{echo 'just carry on';}
In terms of setting up the iPhone there are quite a few iPhone frameworks see here for list around which will speed the development and if you are developing on a Mac with Snow Leopard and the latest SDK then there is now a built-in project in dashcode to produce one.
I don't know if this is helping you know as you already started to develop your page. But this kit is the ultimate kit for IPhone web as far as i know. Check it out.
iWebKit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With