如何使用uibutton切换到另一个xib?

时间:2011-05-22 13:06:13

标签: iphone uiviewcontroller uibutton xib tabbar

我的申请包含TabBar和四个观看次数(FirstView.xibSecondView.xibThirdView.xibFourthView.xib)。在ThirdView.xib我有UIButton,按下后,需要加载带有动画的FifthView.xib。怎么做?

1 个答案:

答案 0 :(得分:0)

NSArray *array = [[NSBundle mainBundle] loadNibNamed:"FifthView.xib" owner:nil options:nil];
for ( id object in array ) {
    if ( [object isMemberOfClass:[FifthView class]] ) {
        fifthView = (FifthView*)[object retain];
        break;
    }
}

...

[UIView transitionFromView:thirdView 
                    toView:fifthView
                  duration:1 
                   options:UIViewAnimationOptionTransitionFlipFromLeft
                completion:nil];