Hi guys,
I have a trouble trying to hide an activityIndicator created from Ti.UI.createActivityIndicator.
Basically, when the screen is open, an activity indicator will be created as activityIndicator and added to the screen. So when my data is loaded, it will hide it. However, is it not hiding.
Thanks in advance.
Snippet of my codes:
var activityIndicator = Ti.UI.createActivityIndicator({ color : 'green', font : { fontFamily : 'Helvetica Neue', fontSize : 26, fontWeight : 'bold' }, message : 'Loading...', height : Ti.UI.SIZE, width : Ti.UI.SIZE }); self.add(activityIndicator); activityIndicator.show(); var xhr = Ti.Network.createHTTPClient({ onload : function(e) { // this function is called when data is returned from the server and available for use // this.responseText holds the raw text return of the message (used for text/JSON) // this.responseXML holds any returned XML (including SOAP) // this.responseData holds any returned binary data Ti.API.info(this.responseText); var jsonObject = JSON.parse(this.responseText); if (jsonObject.status == "SUCCESS") { Ti.API.info('fuck'); Ti.API.info(activityIndicator); activityIndicator.hide(); } onerror: function(e){ //mycodes here } });