Titanium Community Questions & Answer Archive

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

Default Activity Indicator for webview shows on left of screen and is cut off

On the app I'm working on, whenever I load up a webview and the page is loading, the activity indicator can be seen on the left side of the screen, and is cut off in the middle (so half of it isn't visible).

It seems like the activity indicator is working (disappears when webview has loaded) but the location is just in the wrong spot…

can anyone help me out with the code needed to move it to a visible part of the screen?

Thanks ahead of time!!

— asked June 1st 2010 by Jimmy Lesondak
  • activity
  • activityindicator
  • default
  • load
  • loading
  • position
  • webview
0 Comments

3 Answers

  • Accepted Answer

    I've seen this before, try setting the webview obj with width and height to '100%' instead. It worked for me.

    — answered June 1st 2010 by Daniel Lim
    permalink
    4 Comments
    • I'm seeing the same issue (with 3.0) and setting the webview width and height to '100%' doesn't resolve the issue.

      — commented January 22nd 2013 by Gopi Reddy
    • Im having the exact same issue with 3.0. It seems extremely intermittent, sometimes it will center other times not.

      — commented January 25th 2013 by Erik Sundahl
    • Same, neither 100%, 320, or Ti.UI.FILL worked for me

      — commented March 14th 2013 by James Low
    • @James Low, thanks. That worked! :)

      — commented August 2nd 2013 by Sufian Babri
  • The same question at stackoverflow suggests if you add the webview to a view with top/left/bottom/right then it will appear in the middle. That worked for me:

    var view = Ti.UI.createView({top:0,left:0,bottom:0,right:0});
    win.add(view);
    var web = Titanium.UI.createWebView({url:url});
    view.add(web);
    

    http://stackoverflow.com/questions/11356990/how-to-align-web-view-activity-indicator-center-in-titanium-sdk-iphone

    — answered March 14th 2013 by James Low
    permalink
    3 Comments
    • Worked for me too, thanks!

      — commented May 28th 2013 by Sven Groot
    • Works great on Titanium 3.1.1

      — commented September 24th 2013 by Jens Lorentsson
    • Thanks,It works.

      — commented June 6th 2015 by Saurabh Gaur
  • Hi,

    I don't see these issues when using webviews. If you have some code and screenshots of what you're seeing, that would be useful for us to help you out ;)

    — answered June 1st 2010 by Kosso
    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.