Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone UIToolbar在显示的视图中向上滑动,UIView向下滑动_Iphone - Fatal编程技术网

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间隙的任何想法