且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使UIActivityIndi​​cator居中?

更新时间:2023-01-25 11:48:22

两个问题:


  1. 首先,self.view.center是当前视图框架在其父框架上的中心。如果你想要当前视图的中心,你想要 CGPointMake(self.view.frame.size.width / 2.0,self.view.frame.size.height / 2.0);

其次,您当前的视图不包含导航栏,因此您将其置于导航栏下方屏幕的空间中心。这也会让它看起来更低。

Second, your current view does not include the navigationbar, so you're centering it on the space of the screen below the nav bar. That will also make it look lower.