iphone - Background image for activityIndicatorView -
so, creating activityindicator programmatically. works fine. want add background image indicator , center in middle of view. idea how achive that?
here's code:
- (void) indicatorviewshow: (bool)show { if (show) { //--- create layout rect cgrect indicatorrect; indicatorrect.origin = self.view.center; indicatorrect.size.width = 50; indicatorrect.size.height = 50; indicatorrect.origin.x -= indicatorrect.size.width / 2; //--- create indicator view indicatorview = [[indicatorview alloc] initwithframe: indicatorrect]; indicatorview.activityindicatorviewstyle = uiactivityindicatorviewstylewhitelarge; [indicatorview startanimating]; [self.view addsubview: indicatorview]; //--- show network activity [uiapplication sharedapplication].networkactivityindicatorvisible = yes; } else { //--- hide network activity [uiapplication sharedapplication].networkactivityindicatorvisible = no; [indicatorview stopanimating]; //--- remove indicator view indicatorview.hidden = yes; [indicatorview release]; indicatorview = nil; } }
you subclass uiactivityindicator, add uiimageview in class, , have activity indicator background image property
Comments
Post a Comment