0


I'm using sencha touch 2 in my ios app. but the tab panel is too slow, there's is one tab that contains a lot of content, but all the tabs are slow (there's a lag between when the tab is hilighting and the page transition and it takes ~1 second to switch).

I tried the deferredRender parmater but it didn't help.

How should i write my tabPanel to make it faster?

Note : the same page switches tabs faster on android, although in everything else android webview is slower

Thank you

Dany Y
  • 6,833
  • 6
  • 46
  • 83

1 Answers1

2

This question is quite similar to yours:

PhoneGap 1.4 wrapping Sencha Touch 2.X - What about performance?

As I said in that topic, generally Android's transition between views is faster but other effects (especially scrolling) are much slower than iOS.

Right now the only solution I've known is to keep your DOM light-weighted. Don't try to create all views that might appear in your app and call them later through setActiveItem() because it enlarges your DOM so terribly. When you switch to a new tab, I recommend that you should destroy all other tabs' child components (and only keep some variables if you want to restore their states when switch back).

Community
  • 1
  • 1
Thiem Nguyen
  • 6,345
  • 7
  • 30
  • 50
  • 1
    Hi, Thank you for ur answer. Can u just advice me on the best way to do this. Is it enough to create my items, but add them to my tabs only when activated and destroy the items of the old ones ? kind of `activeitemchange : function(container, newValue, oldValue,opts) oldValue.getItems().items.length = 0;newValue.add(tabItems[index-1]);` – Dany Y Apr 18 '12 at 11:08
  • Yes. This saves a lot of memory and time for DOM searching, but on the other hand, it takes time to re-construct DOM elements since you've destroyed them before, during deactivation. But basically, it's a good practice to improve your app performance. – Thiem Nguyen Apr 18 '12 at 14:02
  • Thank you. i can remove them from the DOM, and leave them as javascript variables, i guess this can save some time – Dany Y Apr 18 '12 at 14:14