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.
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!