I have created an activity indicator and a label below it in a uiview sub class and calling it in many different tabs.It works as intended in most of the places i'm calling it except in Graph Hosting views(CPTGraphHostinView). In this particular view the subView appears to be upside down.The label goes above the spinner.I tried with imageview instead of label, and its the same upside down image.
Here is my initWithframe method
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
// Initialization code.
NSLog(@"AI: init with frame");
spinnerView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
spinnerView.center = self.center;
[self addSubview:spinnerView];
UILabel* loadingMsg = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 90.0f, 30.0f)];
loadingMsg.center = CGPointMake(spinnerView.center.x , spinnerView.center.y + spinnerView.bounds.size.height/2 +10);
loadingMsg.textAlignment = UITextAlignmentCenter;
loadingMsg.backgroundColor = [UIColor clearColor];
loadingMsg.text = @"loading";
[self addSubview:loadingMsg];
}
return self;
}
Here is the call to activityIndicator in view did load
ob_activityobject = [[ActivityIndicator alloc] initWithFrame:self.view.bounds];
[ob_activityobject showInView:self.view];