开发者

how to make websites for iphone

i have a website which i want my users to access from their iphones as well. Would i need to make s开发者_如何学编程eparate webpages for mobiles or is there a template provided in Xcode that lets developers make web applications for iphone?

if i am making the website just my altering the webpages then i am limited by the functionality of the browser safari. But if i am going for Xcode based support for web applications i would be able to use the rich Foundation and UIKit framework.

what is a better option?

thank you in advance.


Check for the browser's user agent using PHP and then redirect the user to a mobile version of your website. You can use the iphone simulator or a browser that can change the user agent (like safari) to test your website. Don't forget to make the UI much cleaner than on your regular website, it should to follow the design philosophy that Apple implemented on the iphone.

$userAgent = $_SERVER['HTTP_USER_AGENT'];

iPad user agent:

Mozilla/5.0 (iPad; U; CPU OS 3_2_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B500 Safari/531.21.10

iPhone user agent:

Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7

iPod user agent:

Mozilla/5.0 (iPod; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜