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 人气:181
blog comments powered by Disqus


  • 从iPhone Tab Bar学到的- 2014-01-29

    在过去的几年中,iPhone成功的使得Tab Bar标签栏导航方式在移动设备上流行起来.Apple将tab bar和其它许多的设计原则整合到了他们的人机交互指南(HIG)中--但有些疑问他们从来没有回答.在过去的几年中我一直从事交互与图形设计,在这篇文章中我将分享一些我的想法有关什么是该做的,什么是不该做的. 第一课:魔法数字是5 这对从事iPhone设计的人来说不是新鲜事.自从iPhone的屏幕宽度为320点(dots)开始(1点=2象素),Apple设计了标准的tab bar不能超过5个ta

  • Hiding the iPhone Tab Bar with TTNavigator 2012-05-28

    If you are using the iPhone Tab Bar in your application, but you need to hide the Tab Bar in any specific situation. And you're using TTNavigator (Three20h) to manage yours View Controllers. This is a very easy task. Let's assume that you want to hid

  • UITabBarController详解 2013-09-08

    当我们想要做一个界面类似 联系人 那样的程序时,就一定会用到 UITabBar,它可以帮我们添加.管理许多的Tab项, 使我们的程序包含不同的操作模式,由于管理UITabBar可能会有些麻烦,所以apple也帮我们对其进行了封装,产生了简单好用的UITabBarController,就像UITableViewController对UITableView的封装,只不过在用到UITabBarController时,我们不用像使用UITableViewController那样去继承它. 一.UITab

  • 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

  • iPhone入门学习汇总 2012-05-17

    目录 1 AddressBook学习笔记 2 UITabBarController学习笔记 3 Objective-C学习文档 4 半翻页动画效果例子 5 iPhone学习文档_快捷键 6 MKMapView学习笔记 7 CoreLocation定位学习笔记 8 Mac入门学习笔记 9 iPhone静态库学习笔记 编辑本段 回目录AddressBook学习笔记 一.基本知识 和UINavigationController类似,UITabBarController也可以用来控制多个页面导航,用户可

  • 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

iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



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

CodeWeblog.com 版权所有 闽ICP备15018612号

processed in 0.038 (s). 11 q(s)