Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在iphone上的UITableView中显示UIActivityindicator_Iphone - Fatal编程技术网

如何在iphone上的UITableView中显示UIActivityindicator

如何在iphone上的UITableView中显示UIActivityindicator,iphone,Iphone,我挣扎了将近一个小时,但我不知道如何在UItableview中显示UIactivity指示器,因为我不能在iphone上使用UItableview中的IB(它不是拖拽) 我用了这个和它的工作原理 但我想在viewDidload中显示 - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { //loadingView =[LoadingView loadingViewIn

我挣扎了将近一个小时,但我不知道如何在UItableview中显示UIactivity指示器,因为我不能在iphone上使用UItableview中的IB(它不是拖拽)

我用了这个和它的工作原理 但我想在viewDidload中显示

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{

//loadingView =[LoadingView loadingViewInView:[self.view.window.subviews objectAtIndex:0]];//.window.subviews
    NSLog(@"dgdddddddddddddddddddd");
    UIView* customView = [[UIView alloc] initWithFrame:CGRectMake(130, 10, 25, 25)];

    //UIView* customView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 30.0, 320.0, 60.0)];
    activityView.center=customView.center;
    [activityView startAnimating];
    [ customView bringSubviewToFront:activityView];
    [customView addSubview:activityView];// [headerLabel release];

    return [customView autorelease];       
}

请建议

如果文件的视图属性链接到UITableView,则不会添加子视图。尝试用包含表视图的普通视图替换视图属性,然后尝试添加指示器。还要尝试将文件所有者类从uitableviewcontroller设置为uiviewcontroller类

我真是太困惑了!为什么会这样?viewController的view属性在这里的区别最小,因为活动指示器作为子视图添加到header视图中。viewController的view属性与此有什么关系?@Raj因为当您滚动或重新加载tableview时,所有单元格、页眉和页脚都堆叠在UITableview的顶部,同时删除上一个单元格、页眉和页脚。我不相信/理解这一点,问题是他无法在IB中拖动UITableview,所以我假设他想把它作为子视图添加到整个tableView中。在这种情况下,为什么不能使用UITableViewController+xib?