views:

28

answers:

1

hi, There is any way to get cell coordinates when pressing on cell?

I have UITableView and i want to show the activityIndicatorView on the cell that was pressed and for that i need the cell coordinates.

the didSelectRowAtIndexPath method dont provide this information.

one more thing , when i show the activityIndicatorView i want from the UITableView to be darker (like in UIAlertView )and when i finished to do some stuff i want to bring the light back . how can i do it?

+3  A: 

[tableView cellForRowAtIndexPath:indexPath] Should let you directly access the cell from the didSelectRowAtIndexPath.

UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
[cell addSubview:myIndicator];
[myIndicator startAnimating];

Also, in this method, do all your manipulations to the rest of the table.

You don't need to bother with coordinates.

DexterW
ok i try this but it put the myIndicator in the left side of the cell and not in the center.any idea?
Amir
Read about uiviews, and read the apple documentation. You need to set the frame of the indicator to be in the center of the cell...Read.
DexterW