gpt4 book ai didi

ios - 如何将 activityindicator 放在 tableview 的中间

转载 作者:可可西里 更新时间:2023-11-01 04:14:18 24 4
gpt4 key购买 nike

我已经放置了事件指示器

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

但这在表格 View 中没有正确居中。因为表格 View 可以滚动。我怎样才能在屏幕中央放置一个微调器。

最佳答案

尝试使用下面的代码:-

    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];

代码输出是:-

enter image description here

关于ios - 如何将 activityindicator 放在 tableview 的中间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17985436/

24 4 0