0
在故事板中,我們只需將按鈕拖動到其目的地並創建一個seque。如果我們使用故事板並使用外部XIB,如何處理seque
,如果我有在故事板上所有這些viewControllers外部XIBs什麼?我不能再次拖動按鈕。該按鈕位於外部XIB中,不再位於故事板中。
那我該怎麼辦?
在故事板中,我們只需將按鈕拖動到其目的地並創建一個seque。如果我們使用故事板並使用外部XIB,如何處理seque
,如果我有在故事板上所有這些viewControllers外部XIBs什麼?我不能再次拖動按鈕。該按鈕位於外部XIB中,不再位於故事板中。
那我該怎麼辦?
你應該爲這個按鈕創建一個IBOutlet。例如,它的名稱爲「buttonPressed」。然後實現這個方法。
- (IBOutlet)buttonPressed
{
YourViewController *yourViewController = [[YourViewController alloc] initWithNibName:@"YourViewController" bundle:nil];
[self.navigationController pushViewController:yourViewController animated:YES];
}
這就是前的ios5的方式來做到這一點。怎麼樣,如果我想塞克,動畫等 –
可以使用塞格斯只能用故事板。如果您不能使用外部XIB。但是你可以使用自定義動畫。 [這](http://stackoverflow.com/questions/1406037/custom-animation-for-pushing-a-uiviewcontroller)可以幫助你,我認爲。 – tagirkaZ
我可以做這種混合動力車嗎?一些視圖控制器獲得故事板,另一個使用外部XIB? –