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

}
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

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

  • DWR trial

    1, call not return value and parameters JAVA Ways 1.1, dwr.xml configuration <dwr> <allow> <create creator="new" javascript="testClass"> <param name="class" value="com.dwr.TestClass" /> ...

  • [Effect] JS pulldown menu

    js library from: http://moofx.mad4milk.net/ (Moofx effect of ultra-lightweight class library javascrip) Click here facie effect of the first bar Usage: 1. Add a JS library CODE: <script src="prototype.lite.js" type="text/javascript"

  • JS + AS + SWFloader, html page dynamically loaded SWF files

    In fact, this is a js call as an example. Html in the dynamic control in the swf file to import. Nothing to add to that, the following code into the. (Just started to write things, the code quality is still relatively poor, huh, huh, we mention many valua

  • From Java to Ruby

    Java is a mature, tested, and are quick (), or wordy. From Java to the Ruby, could be expected to reduce the code size, but also could be expected to spend less time to put together a quick prototype. Similarities: And Java, in Ruby, the ... Garbage ...

  • JS to control the size of upload files

    JS to control the size of upload files: var fileSize = 160; var fileType = "jpg, gif, bmp, png"; var bool = false; / / 0 on behalf of From the type of wrong, one representative of the type of upload correctly var str = ""; function che

  • autotest, make your test automation RSpec (b) [windows]

    Following Part <<autotest, Let your rspec test automation >> We are the RSpec implementation of automated testing, but always want to open a dos shell look at the recent test results are also too cumbersome. Well, let us to achieve automated t

  • hibernate the third study (mapping file configuration)

    If you do not want to use the default hibernate.cfg.xml file as a configuration file, we can also specify the configuration file name: File file = new File ( "C: \ \ myhibernate.xml"); Configuration config = new Configuration (). Configure (file

  • Struts2 Spring Hibernate integration of easy

    1. Add Spring 2.0 in Libraries Choose the following four jar, and configure the / WEB-INF/lib under Spring2.0 AOP Libraries Spring2.0 Core Libraries Spring2.0 Persistence Core Libraries Spring2.0 WEb Libraries At the same time, the applicationContext ...

  • Struts2 Spring Hibernate's easy to integrate

    1. Add Spring 2.0 in Libraries Choose the following four jar, and configure the / WEB-INF/lib under Spring2.0 AOP Libraries Spring2.0 Core Libraries Spring2.0 Persistence Core Libraries Spring2.0 WEb Libraries At the same time, the applicationContext ...

  • Hibernate Inteceptor

    The end of the project stage, the client suddenly put forward a very troublesome but normal demand, the system records all changes must be carried out. Formats such as: 2004.1.1 12:30 Ikuya wind orders Sales Order Date 2004.1.2-> 2004.1.3 The firs ...

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries