Disabling the back view or window when activity indicator is being shown

You must Login before you can answer or comment on any questions.

Hi I need to disable the window or the whole back view when activity indicator is being shown.i.e, when activity indicator is running no other control should be active. Can anyone help me over this? Thanks

2 Answers

I suppose you want this for iOS. Put the activity indicator in a window and open that window instead of only showing the actind. This way it will behave like an overlay.

Take care to open it with overlay_window.open() and not through a tab or a navigation group.

— answered 11 months ago by Dan Tamas
answer permalink
2 Comments
  • yes i want this in iOS. and navigation group is my basic requirement.

    — commented 11 months ago by Ekjyot Dureja

  • I just told you the solution.

    — commented 11 months ago by Dan Tamas

Or a simple mother view with zIndex property to 1000 :

//
//CREATE CUSTOM LOADING INDICATOR
//
 
// Global indicator view
indicatorView = Ti.UI.createView({
    zIndex:1000,
    visible:false,
    width:Ti.Platform.displayCaps.platformWidth,
    height:Ti.Platform.displayCaps.platformHeight
});
 
//black view
var indicatorActView = Ti.UI.createView({
    height:150,
    width:150,
    backgroundColor:'#000',
    borderRadius:10,
    opacity:0.8,
    zIndex:999
});
 
var indicatorAct = Ti.UI.createActivityIndicator({
    style:Ti.UI.iPhone.ActivityIndicatorStyle.BIG,
    height:50,
    width:50
});
indicatorAct.show();
indicatorActView.add(indicatorAct);
 
 
//message
var indicatorMsg = Ti.UI.createLabel({
    text:'Chargement',
    color:'#FFF',
    width:'auto',
    height:'auto',
    font:{fontSize:20,fontWeight:'bold'},
    bottom:20
});
indicatorActView.add(indicatorMsg);
 
indicatorView.add(indicatorActView);
 
//
//Add global event handlers to hide/show custom indicator
//
Ti.App.addEventListener('show_indicator', function(e) {
    indicatorView.show();
});
 
Ti.App.addEventListener('hide_indicator', function(e) {
    indicatorView.hide({opacity:0,duration:500});
});
 
if(typeof Ti.UI.currentWindow != 'undefined') {
    Ti.UI.currentWindow.add(indicatorView);
}

Your Answer

Think you can help? Login to answer this question!