In the Settings app when you select a Wi-Fi network you can see a table view that has a label and an activity indicator right after the label. Is there some predefined way to create such a UI. Or the only way to do it is to implement the tableView:viewForHeaderInSection
with some code that creates a label and a spinner, calculates the label width and places the spinner right after it?
Asked
Active
Viewed 2,001 times
1

Dmitry Sokurenko
- 6,042
- 4
- 32
- 53
-
@CodaFi how is that in any way related to the post you identified as a dupe? (despite the keyword WiFi). – Till Mar 25 '12 at 16:15
2 Answers
4
Yes, you have the right approach! Create a header view with a label and place an UIActivityIndicator right after it. The calculation is pretty simple:
UILabel* myLabel = ...;
CGSize size = [myLabel.text sizeWithFont: myLabel.font];
UIActivityIndicator* indicatorView = ...;
indicatorView.center = CGPointMake(size.width + indicatorView.frame.size.width, myLabel.center.y);

calimarkus
- 9,955
- 2
- 28
- 48
0
UITableViewCell.accessoryView, create a UIActivityIndicator instance and assign to it.

Chris Chen
- 5,307
- 4
- 45
- 49
-
The OP asks for putting the Activity Indicator in Section Header, not in a Tableviewcell – sensslen Jan 25 '13 at 14:18