Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Webview with Transparent BG

Hi Folks,

Is it possible to have a webview with a transparent BG? I was hoping to display html (just text and some h1/h2 tags) in a scrollview with a transparent BG so i can see the background of the app itself! All works fine apart from the current white background! :(

(Tried setting body background: transparent; in the css of the webview as i thought i saw that mentioned somewhere.. no luck!)

Thanks! :)
Scott

— asked June 8th 2010 by Scott Robinson
  • background
  • css
  • html
  • transparent
  • webview
0 Comments

2 Answers

  • Accepted Answer

    You can had backgroundColor transparent in your webview :

    var win = Titanium.UI.currentWindow;
    win.backgroundColor = '#B5D5FF';
    
    var web = Titanium.UI.createWebView({html:'<html><body><h1>some test</h1></body></html>',backgroundColor:'transparent'});
    
    win.add(web);
    
    — answered June 8th 2010 by Stephane Pelamourgues
    permalink
    1 Comment
    • Perfect, just what i was looking for. Thanks! :)

      — commented June 8th 2010 by Scott Robinson
  • Hi!

    #
    Even backgroundColor:&#39;clear&#39; works for me!

    — answered October 8th 2012 by Pushpinder Nayyar
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.