Iphone 如何将启动屏幕加载视图推到加载状态
我已经尝试了这几天,但还没有取得任何成功。 一旦应用程序启动,我将加载各种XML数据。但目前我还没有加载任何加载页面来显示页面的加载情况。我想添加一个显示数据加载的页面,然后将加载视图页面推送到选项卡栏控制器页面。 如果有人有任何例子或想法来分享,将会非常有帮助Iphone 如何将启动屏幕加载视图推到加载状态,iphone,objective-c,uitabbarcontroller,Iphone,Objective C,Uitabbarcontroller,我已经尝试了这几天,但还没有取得任何成功。 一旦应用程序启动,我将加载各种XML数据。但目前我还没有加载任何加载页面来显示页面的加载情况。我想添加一个显示数据加载的页面,然后将加载视图页面推送到选项卡栏控制器页面。 如果有人有任何例子或想法来分享,将会非常有帮助 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions { [n
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions {
[navController.navigationBar setTintColor:[UIColor blackColor]];
LoadingViewController *lvc = [[LoadingViewController alloc] initWithNibName:@"LoadingView" bundle:nil];
// Adding the modal view controller to loading View controller on Main Tab bar controller. Hope its correct
[self.rootController presentModalViewController:lvc animated:YES];
[window addSubview:rootController.view];
[window makeKeyAndVisible];
[self URL];
[lvc release];
return TRUE;
}
有很多方法可以做到这一点。一个选项是创建一个显示加载视图的viewcontroller。将选项卡栏控制器添加到窗口。然后将加载视图控制器作为选项卡栏控制器上的模式视图控制器呈现。然后开始xml解析,并在解析完成后关闭模式控制器。如何将加载视图控制器添加为选项卡栏控制器顶部的模式视图控制器>?我需要使用IB吗?UITabBarController是UIViewController的一个子类。所有视图控制器都有一个名为presentModalViewController:animated:的方法。使用该方法显示加载视图控制器。在应用程序委托中执行此操作。-(BOOL)应用程序:(UIApplication*)应用程序使用选项完成启动:(NSDictionary*)启动选项{[navController.navigationBar setTintColor:[UIColor blackColor]];LoadingViewController*lvc=[[LoadingViewController alloc]initWithNibName:@“LoadingView”捆绑包:nil];[self.rootController presentModalViewController:lvc动画:是];[window addSubview:rootController.view];[window makeKeyAndVisible];[self URL];[lvc release];返回TRUE;}如前所述,我已经添加了加载视图控制器,但现在如何删除加载视图控制器。请查看lvc实例中的文档,完成后只需调用[self DismissModalViewController:YES]。