0
我有2个带有navigationcontroller的视图控制器(initWithRootView)。 然后,我添加的活性与使用uinavigationcontroller的uiviewcontroller的中心
CGPoint centerPoint = self.view.center;
centerPoint.x -= self.view.frame.origin.x;
centerPoint.y -= self.view.frame.origin.y;
self.activity.center = centerPoint;
self.activity.hidesWhenStopped = YES;
[self.view addSubview:self.activity];
但是一个视图 - 控制节目活动中心,一个视图控制器没有。我尝试通过导航的高度和StatusBar的高度来减少y,并得到相同的结果。
你能告诉我你想要达到什么样的努力呢? –
如果你想在'self.view'中心的activityView,你可以测试这个代码'actView.frame = CGRectMake(0,0,67,67); [self.view addSubview:actView]; actView.center = self.view.center;'。 –
我想添加活动到我的viewcontroller视图的中心。 – user418304