【发布时间】:2013-04-07 19:44:54
【问题描述】:
我有一个UINavigationController,当一个事件被触发时,我需要一个自定义的UIView 出现在NavigationBar 的正下方,但不妨碍当前的ViewController。我还需要在弹出/推送控制器时使UIView 持久化。
-----------------
| Status Bar |
-----------------
| Nav Bar |
-----------------
| Custom View |
-----------------
| |
| View Controller |
| |
-----------------
我目前正在让我的CustomView (UIView) 设置框架,例如:
- (id)initWithNavigationController:(UINavigationController *)navController {
self.navController = navController;
return [self init];
}
- (id)init
{
CGRect viewFrame = self.navController.view.frame;
return [self initWithFrame:CGRectMake(viewFrame.origin.x,
self.navController.navigationBar.frame.origin.y + self.navController.navigationBar.frame.size.height,
viewFrame.size.width,
40.0)];
}
这是解决这个问题的方法吗?
【问题讨论】:
标签: ios uinavigationcontroller