回答

1

據我所知,它不能水平移動。而且,當您使用presentModalViewController:animated:時,以前的視圖將消失(空白)。但是你可以做這樣的(添加所需的視圖到你的窗口的頂部):

UIViewController *modalViewController = [[UIViewController alloc] init]; 
[modalViewController.view setFrame:CGRectMake(320.0f, 0.0f, 320.0f, 480.0f)]; 
[modalViewController.view setBackgroundColor:[UIColor redColor]]; 
[[UIApplication sharedApplication].delegate.window addSubview:modalViewController.view]; 

[UIView animateWithDuration:0.25f 
         delay:0.0f 
        options:UIViewAnimationOptionCurveEaseInOut 
       animations:^{ 
        [modalViewController.view setFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)]; 
       } 
       completion:nil]; 

[modalViewController release]; 
相關問題