osx - NSActivityindicator for a web browse -


i want circular activity indictor should come when web view start loading , should disappear when load complete

i have tried

-(void)webviewdidstartload;(nsurl*)  {         [nsprogressindicator startanimation:self];  } 

please should type in .h , .m

first thing should add uiactivityindicatorview (this standard loading animation in ios) in storyboard / xib / viewcontroller (anything you're using).

then, in .m file of uiwebviewdelegate, should following :

- (void) viewdidload {     [super viewdidload];      // instantiate here activity view if you're creating programmatically     // hide it, user must not see if web view not loading     self.activityindicatorview.hidden = true;     self.activityindicatorview.hideswhenstopped = true; // hide when animation stopped }  - (void)webviewdidstartload:(uiwebview *)webview {     self.youractivityindicatorview.hidden = false;     [self.youractivityindicatorview startanimating];  }  - (void)webviewdidfinishload:(uiwebview *)webview {     [self.youractivityindicatorview stopanimating]; // hide automatically } 

in case, i'm used add in uiview, way can add loading message (or else). when start/stop animation, show/hide corresponding view. here find more information uiwebviewdelegate , here uiactivityindicatorview.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -