iOS UI 布局
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | - ( BOOL )application:(UIApplication *)application didFinishLaunchingWithOptions:( NSDictionary *)launchOptions { self .window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self .window.backgroundColor=[UIColor whiteColor]; RootViewController *newInfoViewController = [[RootViewController alloc]init]; newInfoViewController.title = @ "资讯" ; newInfoViewController.tabBarItem.image = [UIImage imageNamed:@ "infomation.png" ]; UINavigationController *infoNav = [[UINavigationController alloc] initWithRootViewController: newInfoViewController]; infoNav.view.frame = CGRectMake(0, 0, 320, 460); infoNav.navigationBar.hidden = YES ; SecViewController *hotPicViewController = [[SecViewController alloc] init]; hotPicViewController.title = @ "热图" ; hotPicViewController.tabBarItem.image = [UIImage imageNamed: @ "hotPic.png" ]; UINavigationController *pictureNav = [[UINavigationController alloc] initWithRootViewController: hotPicViewController]; pictureNav.view.frame = CGRectMake(0, 0, 320, 460); pictureNav.navigationBar.hidden = YES ; ThirdViewController *topicViewController = [[ThirdViewController alloc] init]; topicViewController.title = @ "分类" ; topicViewController.tabBarItem.image = [UIImage imageNamed: @ "topic.png" ]; UINavigationController *topicNav = [[UINavigationController alloc] initWithRootViewController: topicViewController]; topicNav.view.frame = CGRectMake(0, 0, 320, 460); topicNav.navigationBar.hidden = YES ; FourViewController *favoriteViewController = [[FourViewController alloc] init]; favoriteViewController.title = @ "收藏" ; favoriteViewController.tabBarItem.image = [UIImage imageNamed: @ "favorite.png" ]; UINavigationController *favNav = [[UINavigationController alloc] initWithRootViewController: favoriteViewController]; favNav.view.frame = CGRectMake(0, 0, 320, 460); favNav.navigationBar.hidden = YES ; FiveViewController *setting = [[FiveViewController alloc] init]; setting.title = @ "设置" ; setting.tabBarItem.image = [UIImage imageNamed: @ "more.png" ]; UINavigationController *settingNav = [[UINavigationController alloc] initWithRootViewController: setting]; settingNav.navigationBar.hidden = YES ; UITabBarController *tabBarController = [[UITabBarController alloc] init] ; tabBarController.viewControllers = [ NSArray arrayWithObjects:infoNav, pictureNav, topicNav, favNav, settingNav, nil ]; self .window.rootViewController = tabBarController; [ self .window makeKeyAndVisible]; return YES ; } |
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步