开发者

Problem With Views Inside of TabBars (iPhone)

I have a UITableView that I am placing inside a TabView. I am trying to put a "spinner" and a label in the center of the TableView. When I view I try to view it inside the TabBar, I do not see the spinner or label. When I view this nib by itself, I see the spinner and TabBar.

There seems to be s开发者_开发百科omething about views / tabbars that I am not getting...


Instead of adding the UILabel and UIActivity indicator on the tableview in the nib, I suggest you add them to the view containing the tableview by adding them in viewDidLoad or an appropriate method of your view controller. e.g.

UIActivityIndicator activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
[activityIndicator setCenter:CGPointMake(160,200)];
[self.view addSubview:activityIndicator]; 

Similarly you can add the label and position it in the view.

You can then add

[activityIndicator startAnimating]; 

and

[activityIndicator stopAnimating];

wherever you want the spinner to start or stop animating. I am not sure what you want to do with the label. If its to display a loading message, you can make the label hidden or visible as appropriate.


if you are putting Label On the UITableView than chances are there that TableView will be overlapped on your label and spinner...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜