• iOS开发>学无止境


    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

        self.window.backgroundColor = [UIColor whiteColor];

    UITabBarController *mainTabBar = [[UITabBarController alloc] init];

        UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kMFMainWidth, 49)];

        backView.backgroundColor = kMFMyRed;

        [mainTabBar.tabBar insertSubview:backView atIndex:0];

        mainTabBar.tabBar.opaque = YES;

        

        MFMainPageViewController *mainPage = [[MFMainPageViewController alloc] init];

        mainPage.tabBarItem.title = @"首页";

    // 选中及未选中的图标

         [mainPage.tabBarItem setFinishedSelectedImage:[[UIImage imageNamed:@"home_tabBar_home_icon_sel"]

                                                        imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]

                           withFinishedUnselectedImage:[[UIImage imageNamed:@"home_tabBar_home_icon_nor"]

                                                        imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];

        UINavigationController *mainPageNav = [[UINavigationController alloc] initWithRootViewController:mainPage];

    //设置字体显示颜色

        [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],

                                                           UITextAttributeTextColor,

                                                           nil]

                                                 forState:UIControlStateNormal];

        [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:kMFMyAuratus,

                                                           UITextAttributeTextColor,

                                                           nil]

                                                 forState:UIControlStateSelected];

        self.window.rootViewController = mainTabBar;

        

        [self.window makeKeyAndVisible];

    本内容来自: 超越昨天(学无止境) - http://www.cnblogs.com/xvewuzhijing/
  • 相关阅读:
    Visual C#使用DirectX实现视频播放
    windows WMIC命令大全
    WMI 无法监视时必须要尝试的手段 winmgmt /resyncperf
    DirectX技术实现视频会议中的音频通信
    c++引用
    c++模板详解
    四元数
    static_cast 和 dynamic_cast
    C++堆和栈详解(转)
    设计模式六大设计原则
  • 原文地址:https://www.cnblogs.com/xvewuzhijing/p/4982184.html
Copyright © 2020-2023  润新知