0
我是ios中的新手,所以請以此來評判我的問題。視圖控制器的動畫加載
我有一個可以使用的代碼。在代碼中,我有一個垂直的Tabbar控制器從FSVerticalTabBarController繼承。我們使用這個tabbar控制器在視圖控制器之間切換。
我想要的是讓viewcontrollers想出一個動畫。任何類型的默認動畫都可以。我怎樣才能做到這一點?這裏的代碼,並感謝您的幫助:
@implementation AIVerticalTabBarController
@synthesize appDelegate;
- (void)viewDidLoad
{
[super viewDidLoad];
[self setDelegate:self];
[[self tabBar] setBackgroundColor:[UIColor darkGrayColor]];
NSArray *titles = [NSArray arrayWithObjects:@"Home", @"Export", @"Settings", @"Titles", @"Slides", @"Text doc", nil];
NSArray *viewClasses = [NSArray arrayWithObjects:@"AIViewController", @"AIViewController", @"AIViewController", @"AITitlesViewController", @"AISlidesViewController", @"AIViewController", nil];
NSMutableArray *controllersToAdd = [[NSMutableArray alloc] init];
for (NSUInteger i = 0; i < [titles count]; i++) {
AIViewController *viewC = [[NSClassFromString([viewClasses objectAtIndex:i]) alloc] init];
[viewC setAppDelegate:appDelegate];
UITabBarItem *tbi = [[UITabBarItem alloc] initWithTitle:[titles objectAtIndex:i] image:nil tag:i];
[viewC setTabBarItem:tbi];
[controllersToAdd addObject:viewC];
}
[self setViewControllers:[NSArray arrayWithArray:controllersToAdd] animated:YES];
}
@end
可能重複:HTTP:// stackoverflow.com/questions/5161730/iphone-how-to-switch-tabs-with-an-animation – tobiasbayer