web applications - Titanium MobileWeb App - Flashing Backgrounds -
got strange problem,
on main window i've got backgroundimage
however whenever click anywhere on screen, or try focus in textfields flashes
i've added video demonstrate behavior
http://www.youtube.com/watch?v=w01vuq_9djy
the styling on window this:
"#main": { backgroundcolor:"#f4b7d1", backgroundimage: "/images/bg.png" }
i've tried
"#main": { backgroundcolor:"#f4b7d1", backgroundimage: "/images/bg.png", backgroundfocusedimage: "/images/bg.png", backgroundselectedimage: "/images/bg.png" }
any appreciated, thanks
i encountered problem well.
the root cause titanium reassigning backgroundimage attribute after every click-event, regardless of if actual attribute has been changed.
to fix issue, can hack element.js file handles backgroundimage update.
the edit can applied in 1 of 2 places (only tested on windows, version 3.1.3.ga):
%projectfolder%\build\mobileweb\titanium\ti\_\ui\element.js
here editing generated js file , have done after every build. option useful if don't want edit actual titanium sdk , want fix on final build.
c:\%user folder%\app data\roaming\titanium\mobilesdk\win32\3.1.3.ga\mobileweb\titanium\ti\_\ui\element.js
if edit file, changing titanium sdk. have repeat edit when upgrade new sdk version.
choose file , apply edit starting @ line 534:
change:
bi = style.url(bi); nodestyle.backgroundimage.replace(/'|"/g, '').tolowercase() !== bi.tolowercase() &&(nodestyle.backgroundimage = bi);
to:
bi = style.url(bi); var currentb = nodestyle.backgroundimage; var ind=currentb.lastindexof("/"); var ind2= bi.lastindexof("/"); if(nodestyle.backgroundimage.substr(ind) !== bi.substr(ind2)) { nodestyle.backgroundimage.replace(/'|"/g, '').tolowercase() !== bi.tolowercase() && (nodestyle.backgroundimage = bi); }
this fix causes titanium reset backgroundimage attribute when filename of background image changes. note, code checks if filename changes, not path, adjust code accordingly if matters you.
this edit should work on sdk version: 3.2.0 ga.
Comments
Post a Comment