Iphone UIToolbar在显示的视图中向上滑动,UIView向下滑动
当显示Iphone UIToolbar在显示的视图中向上滑动,UIView向下滑动,iphone,Iphone,当显示UIView时,UIToolbar上的UIToolbar按钮在显示的视图中向上滑动。当按下infobutton以显示modalviewcontroller时,从视图中,modalviewcontroller会向下滑动 UIToolbar和Modalviewcontroller在Mainviewcontroller中的行为正常,即UIToolbar不向上滑动,而Modalviewcontroller不向下滑动 - (void)displayviewsAction:(id)sender {
UIView
时,UIToolbar
上的UIToolbar
按钮在显示的视图中向上滑动。当按下infobutton
以显示modalviewcontroller时,从视图
中,modalviewcontroller会向下滑动
UIToolbar
和Modalviewcontroller
在Mainviewcontroller
中的行为正常,即UIToolbar
不向上滑动,而Modalviewcontroller
不向下滑动
- (void)displayviewsAction:(id)sender
{
self.view = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]autorelease];
[self.view setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
PageOneViewController *viewController = [[[PageOneViewController alloc] init]autorelease];
[self.view addSubview:viewController.view];
[self.view addSubview:self.toolbar];
}
你知道为什么会发生这种情况吗?我应该怎么做才能解决它。解决了这两个问题中的一个
加入这句话
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
移除了Modalview控制器拆除时出现的间隙
现在displayviewsAction基本上是这样的
- (void)displayviewsAction:(id)sender
{
self.view = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]autorelease];
[self.view setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
PageOneViewController *viewController = [[[PageOneViewController alloc] init]autorelease];
[self.view addSubview:viewController.view];
[self.navigationController setToolbarHidden:NO];
[self.view addSubview:toolbar];
}
但在加载视图时,仍在与底部的uitoolbar间隙作斗争。如何从视图底部解决UIToolbar间隙的任何想法