开发者

How can I switch to another xib using uibutton?

开发者 https://www.devze.com 2023-03-08 01:32 出处:网络
I have application with TabBar and f开发者_运维知识库our views (FirstView.xib, SecondView.xib, ThirdView.xib, FourthView.xib). In ThirdView.xib I have UIButton, when pressed, need to load a FifthView.

I have application with TabBar and f开发者_运维知识库our views (FirstView.xib, SecondView.xib, ThirdView.xib, FourthView.xib). In ThirdView.xib I have UIButton, when pressed, need to load a FifthView.xib with animation. How it can be done?


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];
0

精彩评论

暂无评论...
验证码 换一张
取 消