开发者

TabHost and PhoneGap

I'm trying to add native tabs to my phonegap application on Android. I have a way of doing it where each tab has it's own Activity and use loa开发者_StackOverflow社区dUrl to load Phonegap in the view but it raises two problems.

  1. I'm afraid the app is going to be awfully slow if I have 5 tabs each running Phonegap with some javascript.
  2. If I go back to a tab, the last instance state has been saved, so if i clicked on a link from the tab, clicking back on the tab doesn't load back the main page.

I'm thinking about creating a layout main.xml with a custom linear layout and some callback buttons to call something like : super.loadUrl("javascript: goTo page rand;"); but I'm not sure this is the best way since I would have to rewrite the tabs functionality and design.

Thanks !


Do you really need the tabs to be native because of some architectural constraint? If not how about using a framework like Sencha Touch which provides tab UI controls? There's a demo in the kitchensink code:

http://dev.sencha.com/deploy/touch/examples/kitchensink/

The framework works pretty well from what I've seen inside of Phonegap.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜