從登錄屏幕要前往一類我的應用程序說CLASSA,這樣查看包含導航欄和標籤欄移到一些4毫米向下
classA *objUserHome = [[classA alloc]init];
[self presentModalViewController:objUserHome animated:YES];
[objUserHome release];
和ClassA的是有一個導航欄和的TabBar (在這5個選項卡),我創建了我的標籤欄編程這樣
- (void)viewDidLoad
{
[super viewDidLoad];
//Create tab bar controller and navigation bar controller
tabBarController = [[UITabBarController alloc] init];
NSMutableArray *arrControllers = [[NSMutableArray alloc] initWithCapacity:5];
//Add PunchClock to tab View Controller
PunchClock* objPunchClock = [[PunchClock alloc] initWithTabBar];
NavigationController = [[UINavigationController alloc] initWithRootViewController:objPunchClock];
NavigationController.navigationBar.tintColor = [UIColor brownColor];
[arrControllers addObject:NavigationController];
[NavigationController release];
[objPunchClock release];
//Add Time_Sheet to tab View Controller
Time_Sheet* objTime_Sheet = [[Time_Sheet alloc] initWithTabBar];
NavigationController = [[UINavigationController alloc] initWithRootViewController:objTime_Sheet];
NavigationController.navigationBar.tintColor = [UIColor brownColor];
[arrControllers addObject:NavigationController];
[NavigationController release];
[objTime_Sheet release];
//Add PTO to tab View Controller
PTO* objPTO = [[PTO alloc] initWithTabBar];
NavigationController = [[UINavigationController alloc] initWithRootViewController:objPTO];
NavigationController.navigationBar.tintColor = [UIColor brownColor];
[arrControllers addObject:NavigationController];
[NavigationController release];
[objPTO release];
//Add PunchClock to tab View Controller
CrewPunch* objCrewPunch = [[CrewPunch alloc] initWithTabBar];
NavigationController = [[UINavigationController alloc] initWithRootViewController:objCrewPunch];
NavigationController.navigationBar.tintColor = [UIColor brownColor];
[arrControllers addObject:NavigationController];
[NavigationController release];
[objCrewPunch release];
//Add PunchClock to tab View Controller
Reports* objReports = [[Reports alloc] initWithTabBar];
NavigationController = [[UINavigationController alloc] initWithRootViewController:objReports];
NavigationController.navigationBar.tintColor = [UIColor brownColor];
[arrControllers addObject:NavigationController];
[NavigationController release];
[objReports release];
// Add this view controller array into the tab bar
//self .viewControllers = arrControllers;
tabBarController .viewControllers = arrControllers;
[arrControllers release];
[self.view addSubview:[tabBarController view]];
}
而且ClassA is inherited from UIViewController
現在的問題是,導航到CLASSA,鑑於CL的後assA向下移動約4mm 爲何如此?我該如何解決這個問題,請幫助我,提前thanx
你使用界面生成器:
這可以通過使用可以預防嗎? (對於視圖,而不是特定的標籤欄),因爲視圖可能設置得太小? – nbsp 2012-07-09 04:58:21
@nbsp不,我沒有使用XIB,編程方式我創建了視圖 – Ravi 2012-07-09 05:04:23