答えて

1

私が知る限り、それは水平に動かすことはできません。さらに、presentModalViewController:animated:を使用すると、前のビューは表示されなくなります(空白になります)。しかし、あなたは(あなたのウィンドウの上部に、ご希望のビューを追加)このように行うことができます:私は上記の代わりに、承認された解答のUIStoryboardSegueをお勧めします

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]; 
関連する問題