我开始在标签栏应用程序模板中开发应用程序..
这里我的第一页是登录页面,在loagin后进入主页,所有导航都会发生..
这里我不想只在登录页面中使用标签栏。如何做到这一点?
谢谢......
答案 0 :(得分:0)
在第一个选项卡上,添加您是否登录所需的任何检查,如果没有,则显示带有登录字段的模态视图。
//some test here to determine state of self.registered
if(self.registered==FALSE){
LoginViewController *login = [[LoginViewController alloc] initWithNibName: @"loginView" bundle: nil];
login.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self.navigationController presentModalViewController:login animated:YES];
[login release];
}
答案 1 :(得分:0)
有了这个你可以隐藏和如何uitabbarcontroller -
- (void) hideTabBar:(UITabBarController *) tabbarcontroller {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
for(UIView *view in tabbarcontroller.view.subviews)
{
if([view isKindOfClass:[UITabBar class]])
{
[view setFrame:CGRectMake(view.frame.origin.x, 480, view.frame.size.width, view.frame.size.height)];
}
else
{
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 480)];
}
}
[UIView commitAnimations];
}
- (void) showTabBar:(UITabBarController *) tabbarcontroller {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
for(UIView *view in tabbarcontroller.view.subviews)
{
NSLog(@"%@", view);
if([view isKindOfClass:[UITabBar class]])
{
[view setFrame:CGRectMake(view.frame.origin.x, 431, view.frame.size.width, view.frame.size.height)];
}
else
{
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 431)];
}
}
[UIView commitAnimations];
}
答案 2 :(得分:0)
你可以这样做:
在delegate.h中声明您的观点,
UIView *indicatorView;
UIImageView *splashV;
现在在delegate.m
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
indicatorView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
splashV=[[UIImageView alloc]initWithFrame:CGRectMake(0, 20, 320, 460)];
[splashV setImage:[UIImage imageNamed:@"Default.png"]];
[indicatorView setBackgroundColor:[UIColor clearColor]];
[indicatorView addSubview:splashV];
[self.window addSubview:indicatorView];
}
&安培; 成功登录
-(void)SuccessfulLoginDone
{
[window addSubview:[tabBarController view]];
[window makeKeyAndVisible];
}
希望能够做得更好。