UIToolbar
Mainviewcontroller
上的UIView
显示UIToolbar
时,View
,View
在显示的infobutton
中向上滑动。从UIToolbar
按下Modalviewcontroller
到现在的modalviewcontroller,在解雇时,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];
}
没有向上滑动,{{1}}在解雇时不会滑落。
{{1}}
任何想法为什么会发生,我该怎么做才能解决它。
答案 0 :(得分:0)
解决了这两个问题中的一个问题
添加此声明
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
删除了解雇modalviewcontroller时显示的差距
现在基本上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差距。