开发者

Phonegap on the iPad: Custom html page?

I have a HTML5 App and want to deploy it with Phonegap to iOS devices. The app is designed for smartphones. To make use of the iPad Screen I designed a new layout.

My idea:

Two seperate index.html files as the starting point for the app.

  • index.html for Smartphones
  • index-ipad.html for tablets

How can I make Xcode or Phonegap to load the appropriate html page when startin开发者_运维百科g the app ?

Cheers

Johe


I would use one HTML file with CSS3 media queries doing the different layouts


I would start in Java. Depending on screen size it would call either the index.html or index-ipad.html. But if you're using Phonegap with proper CSS you should be able to use one index.html for both. Phonegap and CSS would do the work.


While I agree with user899641's suggestion that the device abstraction should be happening at the PG/CSS level, it's fairly trivial to modify the native PG library to do what you ask. In the case of iOS, PhoneGapDelegate.m contains a function called startPage which, as written, returns the static string index.html. You can modify this function to apply additional logic and return a different start page accordingly.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜