如何推动启动屏幕加载视图直到其加载
过去几天我已经尝试过此操作,但尚未取得任何成功。 应用程序启动后,我将加载各种 XML 数据。但目前我还没有加载任何加载页面来显示页面的加载。我想添加一个显示数据加载的页面,然后将该加载视图页面推送到选项卡栏控制器页面。 有没有人有任何例子或任何想法来分享,将会非常有帮助。
- (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;
}
I have tried this for past few days and have not got any success yet.
I am loading various XML Data once the application is launched. But currently I have not loaded any loading page to show the loading of the page. I would like to add a page which shows loading of my data and then push that loading view page to the tab bar controller page.
Does anyone have any example or any idea to share it, will be really helpful.
- (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;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有很多方法可以做这样的事情。一种选择是创建一个显示加载视图的视图控制器。将标签栏控制器添加到窗口。然后将加载视图控制器呈现为选项卡栏控制器上的模式视图控制器。然后开始 xml 解析,解析完成后关闭模态控制器。
There are lots of ways to do something like this. One option is to create a viewcontroller that shows your loading view. add your tab bar controller to the window. Then present the loading view controller as a modal view controller over the tab bar controller. Then start your xml parsing, and dismiss the modal controller when the parsing is finished.