How can I switch to another xib using uibutton?
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];
精彩评论