2012-02-07 94 views
0

的UIButton。從Viewinfobutton被按下來呈現modalviewcontroller和解僱後,modalviewcontroller滑落。UIToolbar向上滑動和UIView的時顯示<code>UIView</code>,<code>UIToolbar</code>向上滑動在<code>View</code>顯示在<code>Mainviewcontroller</code>從<code>UIToolbar</code>滑下在顯示視圖

UIToolbarModalviewcontroller無一不是MainviewcontrollerUIToolbar行爲不正常的向上滑動和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]; 

} 

任何想法,爲什麼發生了,我該怎麼辦才能解決它。

回答

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差距。

相關問題