iPhone opening animation and initialized with navigation (UINavigationController) of the tab bar controller (UITabBarController)

Many procedures require the opening animation, but only with Default.png they can not meet their needs, such as short time. The best way to solve their plus a ViewController, my named OpeningViewController.

Inside the AppDelegate.h statement:

    OpeningViewController *openingViewController;
...
    @property (nonatomic, retain) OpeningViewController *openingViewController;

In AppDelegate.m the following:

- (void)applicationDidFinishLaunching:(UIApplication *)application {
        if(openingViewController == nil)
                openingViewController = [[OpeningViewController alloc] initWithNibName:@"OpeningViewController" bundle:nil];

        [window addSubview:openingViewController.view];

        [window makeKeyAndVisible];
        NSAutoreleasePool *pool=[[NSAutoreleasePool alloc] init];
        [self performSelectorInBackground:@selector(removeOpeningView) withObject:nil];
        [pool release];
        return YES;
}

-(void) removeOpeningView
{
        NSAutoreleasePool *pool=[[NSAutoreleasePool alloc] init];
        [NSThread sleepForTimeInterval:3];
        //[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:YES];
        [self setupUI];
        [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];
        [pool release];
}

In - (void) setupUI; set interface UI. I am here is initialized with a navigation (UINavigationController) of the tab bar controller (UITabBarController), as follows:

-(void) setupUI {
        UIColor *titleBarColor=[UIColor colorWithRed:0.0/255.0 green:173.0/255.0 blue:238.0/255.0 alpha:1.0];

        //TabBar Item 1
        mainDirectoryViewController = [[MainDirectoryViewController alloc] initWithNibName:@"MainDirectoryViewController" bundle:nil];
        if (mainDirNavController == nil)
                mainDirNavController = [[UINavigationController alloc] initWithRootViewController:mainDirectoryViewController];
        mainDirNavController.navigationBar.tintColor = titleBarColor;

        //TabBar Item 2
        bookmarkViewController = [[BookmarkViewController alloc] initWithNibName:@"BookmarkViewController" bundle:nil];
        if (bookmarkNavController == nil)
                bookmarkNavController = [[UINavigationController alloc] initWithRootViewController:bookmarkViewController];
        bookmarkNavController.navigationBar.tintColor = titleBarColor;

        //TabBar Item 3
        aboutViewController = [[AboutViewController alloc] initWithNibName:@"AboutViewController" bundle:nil];
        if (aboutNavController == nil)
                aboutNavController = [[UINavigationController alloc] initWithRootViewController:aboutViewController];
        aboutNavController.navigationBar.tintColor = titleBarColor;

        UITabBarItem *customItem1 = [[UITabBarItem alloc] initWithTitle:@" Learning  " image:[UIImage imageNamed:@"some.png"] tag:0];
        UITabBarItem *customItem2 = [[UITabBarItem alloc] initWithTitle:@" Bookmark  " image:[UIImage imageNamed:@"some.png"] tag:1];
        UITabBarItem *customItem3 = [[UITabBarItem alloc] initWithTitle:@" With regard to the  " image:[UIImage imageNamed:@"some.png"] tag:2];

        mainTabBar = [[UITabBarController alloc] init];
        mainTabBar.delegate = self;
        mainTabBar.viewControllers = [NSArray arrayWithObjects:mainDirNavController, bookmarkNavController, aboutNavController, nil];
        mainDirNavController.tabBarItem = customItem1;
        bookmarkNavController.tabBarItem = customItem2;
        aboutNavController.tabBarItem = customItem3;
        [customItem1 release];
        [customItem2 release];
        [customItem3 release];

        [window addSubview:mainTabBar.view];

}
分类:Mobile 时间:2010-08-30 人气:173
分享到:
blog comments powered by Disqus

相关文章

  • Reprinted iPhone development - 3D - build 3D interface (on) 2010-04-22

    iPhone development - 3D - build 3D interface (on) Apple released the iPhone in 2007 is a revolutionary mobile phone industry, a major handset, iPhone OS is: Mac OS X, released last year by the 1.0 firmware upgrade to the current 2.0 firmware. IPhone

  • common method for iphone 2010-03-29

    1 In Xcode, click Run, "" the console to see NSLog NSLog (@ "log:% @", myString); NSLog (@ "log:% f", myFloat); NSLog (@ "log:% i", myInt); 2: displayed on the screen anywhere in the image, do not use interface buil

  • Using the Java connection pool to connect Oracle Database 2010-03-24

    1.Java four ways to connect the database 1 JDBC-ODBC bridge and ODBC driver - in this way, this is a local solution, because the ODBC driver and the bridge code must appear in each user's machine. Fundamentally speaking, this is a temporary solution.

  • Java connection pool using the Oracle database connection 2010-10-26

    1.Java four methods of connecting to the database program 1 JDBC-ODBC bridge and ODBC driver - in this way, this is a local solution, because the ODBC driver and the bridge code must appear in each user's machine. Fundamentally, this is a temporary s

  • 12-step "teaching your iPhone application development 2010-03-29

    iPhone mobile phone for the fashion wave of people, you will definitely be familiar, while the iPhone's popular addition to relying on its good user experience, a large part because the iPhone's App Store in the program. iPhone's App Store for its un

  • Some theoretical knowledge to learn it: human-computer interaction interface design of the three work processes 2008-11-04

    In human and machine interaction (Human Machine Interaction), there is a level, that is what we call the interface (interface). From a psychological sense to points, the interface can be divided into sensory (visual, tactile, auditory, etc.) and emot

  • [Change] iPhone 4 Jailbreak and unlock detailed tutorial 2010-08-06

    August 4 night reported that the Dev-Team, as previously promised the same as in Twitter, in the jailbreak tool released iOS 4 "JailbreakMe 2.0" 48 hours, iPhone Dev-Team crack team today officially released the iPhone 4 to unlock Tools - Ultras

  • Install mac os x and the iphone sdk iphone development environment configuration 2010-09-18

    Install mac os x and the iphone sdk iphone development environment configuration These days are busy in their own PC, install the iphone development environment. I used the approach is: windows xp systems installed in vmware, then the new virtual mac

  • Detailed Android Animation Framework, Part 1 2011-05-16

    IBM DW discovered in an excellent article, can not help but want to turn around, mainly on the Android Tween animation is the principle and implementation, speak better, flattered, haha. Detailed Android Animation Framework, Part 1 http://www.ibm.com

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.146 (s). 12 q(s)