tags:

views:

193

answers:

1

hello! I have a problem with the indicator, my intention is to show "waiting" indicator floating above the UITable when use clicked one of the UITable row, and during the waiting that user still be able to scroll down the table.

But the problem is, when I scrolling the table down, the indicator is moving too! can anyone help on this??

+2  A: 

It all depends where you are placing the UIActivityIndicator. You need to give more detail or show some code. I assume you are putting the activity indicator in a UITableViewCell and then the activity indicator moves with the cell.

If you want the activity indicator not to move with a cell, then you need to add the activity indicator to the view that holds the UITableView. So create a UIViewController that has a UITableView, and a UIActivityIndicator and [self.view addSubview: the UITableView, then the UIActivityIndicator.

Felix Khazin
I put the indicator here:- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { downloadIndicator = [[UIActivityIndicatorView alloc]initWithFrame:CGRectMake(0.0f, 0.0f, 50.0f, 50.0f)]; [downloadIndicator setCenter:CGPointMake(160.0f,220.0f)]; [downloadIndicator setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleGray]; [self.view addSubview:downloadIndicator]; downloadIndicator.hidden = FALSE; [downloadIndicator startAnimating]; [self.view bringSubviewToFront:downloadIndicator]; [contentsTableView reloadData];}
Georg
The table is within an UISubViewController, it is declared like this:@interface appSubViewController : UITableViewController{}
Georg
You are adding the activity indicator to the UITableViewController's view. That's why it's moving when you scroll. UITableView is actually a type of UIScrollView. So since you are placing the activity indicator at (160, 220) that gets moved away when you scroll down.What you should do is:@interface appSubViewController : UIViewController...Then add a UITableView manually to the UIViewController. Now when you do [self.view addSubview on the activity indicator you will be placing it on the UIViewController's view instead of the UITableView and the Activity Indicator won't move away.
Felix Khazin