Problem Description
If you have webviews in your scrollableview, they will reload every time any other view is added to the scrollableview.
Can we try not to reload the webviews already there?
Code Sample
var win = Ti.UI.createWindow({
backgroundColor : 'white'
});
var scrollableview = Ti.UI.createScrollableView({
top : 0,
height : 300,
cacheSize : 10,
showPagingControl:true,
backgroundColor:'white',
});
var webview = Ti.UI.createWebView({
html : '<html><head></head><body><script>var now = Date.now(); document.body.innerHTML = now;</script></body></html>',
top : 0,
height : 300
});
webview.addEventListener('load', function() {
alert('The webview is loaded!');
});
var b = Ti.UI.createButton({
title : "add new view",
top : 400
});
b.addEventListener("click", function() {
scrollableview.addView(Ti.UI.createView({
html : '<html><head></head><body bgcolor="white">hola!</body></html>',
top : 0,
height : 300
}));
});
win.add(scrollableview);
scrollableview.addView(webview);
win.add(b);
win.open();
Steps to reproduce
1. Create a new mobile (classic) project.
2. Paste the testcase to app.js
3. Run in simulator iOS
4. Click on the button to add a second view.
5. You will get an alert that the webview reloaded.
Extra info
Q&A Link:
http://developer.appcelerator.com/question/162289/is-it-possible-to-prevent-webviews-on-scrollableview-from-reloading-when-adding-new-views-to-the-scrollableview
No comments