plz create custom loading that call when you want loading (add that loadingview directly window ) that will display with whole screen so your tab also underneath the loading view. like this. code
-(void) showLoadingView:(NSString *)title
{
boolLodingView = YES;
UIView *viewBack = [loadView viewWithTag:999];
UILabel *lblLoading = [[UILabel alloc] initWithFrame:CGRectMake(23, 6, 110, 25)];
lblLoading.text = @"Loading...";
if (loadView == nil) {
loadView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 480.0)];
loadView.opaque = NO;
loadView.backgroundColor = [UIColor clearColor];
viewBack = [[UIView alloc] initWithFrame:CGRectMake(95, 230, 130, 40)];
viewBack.backgroundColor = [UIColor blackColor];
viewBack.alpha = 0.7f;
viewBack.tag = 999;
viewBack.layer.masksToBounds = NO;
viewBack.layer.cornerRadius = 8;
spinningWheel = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(10.0, 10.0, 20.0, 20.0)];
spinningWheel.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhite;
[spinningWheel startAnimating];
[viewBack addSubview:spinningWheel];
[spinningWheel release];
lblLoading.backgroundColor = [UIColor clearColor];
lblLoading.font = [UIFont fontWithName:@"Helvetica-Bold" size:16.0];
lblLoading.textAlignment = NSTextAlignmentCenter;
lblLoading.textColor = [UIColor whiteColor];
lblLoading.text = @"Loading...";
lblLoading.tag = 1111;
[viewBack addSubview:lblLoading];
[loadView addSubview:viewBack];
}
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
loadView.frame = iphoneFrame;
viewBack.frame = loadiPhone;
}
else
{
loadView.frame = ipadFrame;
viewBack.frame = loadiPad;
}
UILabel *lbl = (UILabel *)[viewBack viewWithTag:1111];
if(lbl)
{
lbl.text = title;
}
[self.window addSubview:loadView];
}
same as if you want hide loading view than
-(void) hideLoadingView
{
if(boolLodingView)
{
[loadView removeFromSuperview];
}
else
{
[loadViewPer removeFromSuperview];
}
}