2013-02-16 33 views
2

在故事板,我們可以直觀地將它設置爲以下
設置過渡到部分捲曲編程/代碼

enter image description here

我們能如何使用.Xib/nib文件是一回事嗎?

[self presentViewController:self.infoController animated:YES completion:nil]; 

上面的代碼只是用模態的風格,但如何設置過渡的風格偏曲。

回答

6

您可以使用此代碼做到這一點:

#import "InfoController.h" 

    - (IBAction)goToSecond:(id)sender { 
     InfoController *vc = [[InfoController alloc] initWithNibName:@"InfoController" bundle:nil]; 
     vc.modalTransitionStyle = UIModalTransitionStylePartialCurl; 
     [self presentViewController:vc animated:YES completion:^{ 
      //completion code here 
     }]; 
    } 
+1

一個小小的建議。請務必使用駱駝情況下'類names'。 – 2013-02-16 10:43:53

+0

@Dilip謝謝.....你的解決方案是正確的one.Although雖然我知道UIModalTransitionStylePartialCurl是一個枚舉,但如何使用它在哪裏使用它是一個問題,我.... – 2013-02-17 07:09:08