zoukankan      html  css  js  c++  java
  • ##DAY9 UITabBarController

    ##DAY9 UITabBarController

    UIViewController的tabBarController

    UIViewController的tabBarItem

    #pragma mark ———————tabBarItem——————————

    UIViewController的tabBarItem属性的属性:

    title 设置显示的文本

    badgeValue 设置显示的角标

    image 设置未点击时的图片

    selectedImage 设置被选中的标签栏的图片

    注意:这里的图片会受tabBarItem的影响

    注意:图片想正常显示,必须是png格式

    #pragma mark ———————UITabBarItem——————————

    三种创建:

    initWithTitle:image:selectedImage:

    initWithTabBarSystemItem:tag:

    initWithTitle:image:tag:

    #pragma mark ———————UITabBarController——————————

    UITabBarController和UINavigationController一样都是继承于UIViewController

    创建:

    init

    属性:

    viewControllers 数组,设置标签视图控制器需要管理的子视图控制器

    selectedIndex 设置标签栏选中的下标

    delegate 代理

    selectedViewController 设置标签栏选中的视图控制器

    tabBar 标签栏

    #pragma mark ———————tabBar——————————

    tabBar的属性:

    <UITabBarDelegate> delegate

    items 数组

    selectedItem

    tintColor

    barTintColor

    其他见头文件

    #pragma mark ——————设置全局外观——————————

    //一键换肤

    //设置全局外观

    //[UITabBar appearance] 找到当前应用的标签栏 UITabBar

    //setTintColor: 修改显示的文本的颜色

    [[UITabBar appearance] setTintColor:[UIColor greenColor]];

  • 相关阅读:
    JAVA基础知识之多线程——线程通信
    为Apache配置虚拟机Virtual Host
    SignalR的坑爹细节
    ashx入侵
    aspnet5安装ef7备忘
    aspnet5备忘
    NHibernate初步使用
    MVC中发生System.Data.Entity.Validation.DbEntityValidationException验证异常的解决方法
    关于NLog的target和Layout
    泛型约束的大概模样
  • 原文地址:https://www.cnblogs.com/chongyu/p/5192436.html
Copyright © 2011-2022 走看看