我開始開發在標籤欄應用程序模板應用..iPhone的TabBar應用
這裏我的第一頁loagin它訪問主頁和所有導航將會發生後登錄頁面..
這裏我不只需要在登錄頁面上標籤欄。如何做到這一點?
感謝.....
我開始開發在標籤欄應用程序模板應用..iPhone的TabBar應用
這裏我的第一頁loagin它訪問主頁和所有導航將會發生後登錄頁面..
這裏我不只需要在登錄頁面上標籤欄。如何做到這一點?
感謝.....
第一個選項卡上,添加任何檢查你需要爲他們是否被登錄,如果沒有,目前與登錄域模態的視圖。
//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];
}
有了這個,你可以隱藏,以及如何的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];
}
你可以這樣做:
在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];
}
希望這將是更好的做這個任務。