zoukankan      html  css  js  c++  java
  • iOS UI 布局

    - (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;
    }
    

      

  • 相关阅读:
    关于防盗链
    原生php登陆注册
    thinkPHP的D方法和M方法用法和区别
    Python中类与对象的关系
    解决_CRT_SECURE_NO_WARNINGS 警告
    骨头汤、豆浆、海带都不能补钙,最补钙的食物是它
    蘑菇鸡蛋汤
    CString和string在unicode与非unicode下的相互转换(转)
    【CString与string转换】不存在从 "LPWSTR" 转换到 "std::basic_string<char, std::char_traits<char>, std::allocator(转)
    LINK : fatal error LNK1104: 无法打开文件“mfc71.lib”(转)
  • 原文地址:https://www.cnblogs.com/hl666/p/3696558.html
Copyright © 2011-2022 走看看