I'm using Struct to build an app, a port of Tweentanium, and I'm using Struct with native tabs (https://github.com/krawaller/Struct/tree/nativetabs).
The issue I'm running into is that when a new window is called to open on the actual device, it takes 1-3 seconds for the window to load, and then the window slides to open after all the views have loaded. This is problematic because you click a button for a new window to load and then the app just sits there for a few seconds and appears to not work... so a user might click open several times in a row.
This doesnt happen on the iOS simulator (which runs like a dream), but on the actual device, there is the 1-3 second delay.
Has anyone else noticed this issue? Right now my solution is to put a setTimeout on the window to a half second before it loads any tableviews or other views, but that seems like a lame hack.
2 Answers
I had a similar delay on loading a few pages after using the Tibar module and processing the information. The solution that the team I work with used was to create a loading bar using an image view similar to the following:
var screen_imageView_loadingBar = Titanium.UI.createImageView({
images:screen_array_images,
duration:100,
repeatCount:0, //infinitely repeat
top:,
left: ,
zIndex:
});
Then you can show the user information is processing without making many changes to your current working functionality.
I tried something a bit different that makes it so I don't need for a preloader to appear when I open a new page.
I think the issue is, my global function to run the window has to run before the tab.open() function gets called.
Instead of creating the Window inside of my global function, I create the window outside of the function and instead pass the window as a parameter.
var browseWindow = Titanium.UI.createWindow({ title:'Browse', barColor:'#5f320c', barImage:'/content/images/bars/top.png', backgroundImage: '/content/images/bg.png' }); homeTab.open(browseWindow, {animated:true}); // call to my global function to pass the window tt.ui.createBrowseView( browseWindow );This seems to work better and the windows slides to open almost instantly on the device, although I'm not positive that this doesn't create any memory leak issues.
Your Answer
Think you can help? Login to answer this question!