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]];

  • 相关阅读:
    Django1.11框架开发流程简述
    Python之Django框架执行流程简介
    Python之Django框架笔记
    Redis数据库学习笔记
    python之MiniWeb框架
    python之正则表达式
    python之with语句结合上下文管理器
    Python之闭包and装饰器
    Ajax之调用一言网站API接口
    python之pymysql模块简单应用
  • 原文地址:https://www.cnblogs.com/chongyu/p/5192436.html
Copyright © 2011-2022 走看看