如何将活动指示器放在表格视图的中间 [英] How to put activityindicator middle of a tableview

查看:85
本文介绍了如何将活动指示器放在表格视图的中间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已放置活动指示器

 spinner.center = CGPointMake( [UIScreen mainScreen].bounds.size.width/2,[UIScreen mainScreen].bounds.size.height/2);
[self.view addSubview:spinner];

但这在表格视图中居中。因为表格视图可以滚动。
如何在屏幕中央放置微调器。

But this is not properly centered in the table view. Because table view can scroll. How can i put a spinner in the center of the screen.

推荐答案

尝试下面的代码:-

    spinner.center = CGPointMake( [UIScreen mainScreen].bounds.size.width/2,[UIScreen mainScreen].bounds.size.height/2);
    yourAppdelegateClass *appDelegate = (yourAppdelegateClass*)[[UIApplication sharedApplication] delegate];
    [appDelegate.window addSubview:spinner];

代码输出为:-

这篇关于如何将活动指示器放在表格视图的中间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆