Xcode - 版本4.2
目标平台 - iPhone
我有一个TabBarController,包含3个标签。所有选项卡都包含通过NavigationController连接到TabBarController的TableViewController。所有TableViewController都显示来自外部URL的数据,并且还有相应的DetailViews。
该应用程序工作正常。
在加载TableView上的数据时,我无法添加'UIActivityIndicatorView'。'storyboard'既不允许我在TableViewController或UINavigationController上添加'UIActivityIndicatorView'控件。
注意:
谢谢,
斯利拉姆
答案 0 :(得分:0)
我正在尝试使用Storyboard做同样的事情,但似乎你应该以编程方式做到这一点: 在ViewController.h中:
@property (strong) UIActivityIndicatorView *activityIndicator;
在viewDidLoad中:
// init with desired state
activityIndicator = [[UIActivityIndicatorView alloc]
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
// set the color
activityIndicator.color = [UIColor blackColor];
activityIndicator.frame = CGRectMake(0.0, 0.0, 40.0, 40.0);
// set the position
activityIndicator.center = CGPointMake(self.view.bounds.size.width/2,
self.view.bounds.size.height/4);
如果您必须处理方向更改,请考虑更新viewWillAppear
和willRotateToInterfaceOrientation
我认为我将花费更少的时间来编写代码,而不是时间来找到更好的方式来使用Storyboard