1、UIKit 框架基本结构

  • 1)控件

    • 屏幕上的所有 UI 元素都叫做控件(也有叫做视图、组件),比如按钮(UIButton)、文本(UILabel)都是控件。

    • 为了便于开发者打造各式各样的优秀 App,UIKit 框架提供了非常多功能强大又易用的 UI 控件,但并不是每一个都很常用,有些控件可能 1 年内都用不上,有些控件天天用,比如 UIButton、UILabel、UIImageView、UITableView 等等。

    • 每个控件都是个容器,能容纳其他控件。内部小控件是大控件的子控件,大控件是内部小控件的父控件。

    • 一个控件看不见有哪些可能:

      • 宽度或者高度其实为 0
      • 位置不对(比如是个负数或者超大的数,已经超出屏幕)
      • hidden == YES
      • alpha <= 0.01
      • 没有设置背景色、没有设置内容
      • 可能是文字颜色和背景色一样
  • 2)控件坐标系

    • 在 UIKit 中,坐标系的原点(0,0)在左上角,x 值向右正向延伸,y 值向下正向延伸。

1.1 各控件之间的层次结构

			   |—— UIAcceleration
|
|—— UIAccelerometer
|
|—— UIAccessibilityElement
|
|—— UIActivity
| |—— UIBarButtonItem
|—— UIBarItem ——————————————————————-|
| |—— UITabBarItem
|—— UIBeziPath
|
|—— UIColor
|
|—— UIDevice
|
|—— UIDocumentInteractionController
|
|—— UIEvent
|
|—— UIFont |—— UILongPressGestureRecognizer |—— UIWindow
| | |
|—— UIGestureRecognizer —————————————|—— UIPanGestureRecognizer |—— UILabel
| | |
|—— UIImage |—— UIPinchGestureRecognizer |—— UIPickerView
| | |
|—— UILocalizedIndexedCollation |—— UIRotationGestureRecognizer |—— UIProgressView
| | |
|—— UILocalNotification |—— UISwipeGestureRecognizer |—— UIActivityIndicatorView |—— UITextView
| | | |
|—— UIMenuController |—— UITapGestureRecognizer |—— UIImageView |—— UITableView
| | |
NSObject ——|—— UIMenuItem |—— UIScrollView ——————————————-——|—— UICollectionView
| |
|—— UINavigationItem |—— UITabBar
| |
|—— UINib |—— UIToolbar |—— UIStepper
| | |
|—— UIPasteboard |—— UINavigationBar |—— UIButton
| | |
|—— UIPopoverController |—— UISimpleTextPrintFormatter |—— UITableViewCell |—— UIDatePicker
| | | |
|—— UIPrintFormatter ———————————————-|—— UIMarkupTextPrintFormatter |—— UIActionSheet |—— UIPageControl
| | | |
|—— UIPrintInfo |—— UIViewPrintFormatter |—— UIAlertView |—— UISegmentedControl
| | |
|—— UIPrinInteractionController |—— UISearchBar |—— UITextField
| | |
|—— UIPrintPageRender |—— UIApplication |—— UIWebView |—— UISlider
| | | |
|—— UIPrintPaper |—— UIView ———————————————————————|—— UIControl ————————————————————|—— UISwitch
| |
|—— UIResponder ———————————————-—————|—— UIViewController —————————————|—— UISplitViewController
| |
|—— UIScreen |—— UITabBarController
| |
|—— UIScreenMode |—— UITableViewController
| | |—— UIImagePickerController
|—— UISearchDisplayController |—— UINavigationController ————|
| | |—— UIVideoEditorController
|—— UITextChecker |—— UICollectionViewController
| |
|—— UITextInputStringTokenizer |—— UIPageViewController
| |
|—— UITextPosition |—— UIActivityViewController
|
|—— UITextRanger
|
|—— UITouch
|
|—— CMMotionManager

1.2 各控件关联说明

	UIWindow                          : UIView                     窗口

        UIApplication                     : UIResponder                应用

        UIView                            : UIResponder                视图

            UILabel                           : UIView                    标签
UIProgressView : UIView 进度条
UIAlertView : UIView 警告框
UIActionSheet : UIView 操作表
UIPickerView : UIView 选择框
UIActivityIndicatorView : UIView 风火轮
UIImageView : UIView 图像视图
UIWebView : UIView 网页视图
UIScrollView : UIView 滚动视图
UITextView : UIScrollView 多行文本视图
UIToolbar : UIView 工具条 UIControl : UIView 控制器 UITextField : UIControl 文本框控件
UIButton : UIControl 按钮控件
UISwitch : UIControl 开关按钮控件
UISegmentedControl : UIControl 选择控件
UISlider : UIControl 滑块控件
UIStepper : UIControl 微调器控件
UIDatePicker : UIControl 日期选择器控件 UIViewController : UIResponder 视图控制器 UITableViewController : UIViewController 表格视图控制器
UITableView : UIScrollView 表格视图
UITableViewCell : UIView 表格视图单元 UINavigationController : UIViewController 导航视图控制器
UINavigationBar : UIView 导航条 UITabBarController : UIViewController 标签视图控制器
UITabBar : UIView 标签条 UICollectionViewController : UIViewController 网格视图控制器
UICollectionView : UIScrollView 网格视图 UIPageViewController : UIViewController 页视图控制器
UIPageControl : UIControl 页控件 UISplitViewController : UIViewController 分割视图控制器 UIImagePickerController : UINavigationController 图像选择视图控制器 UIActivityViewController : UIViewController 分享视图控制器
UIActivity : NSObject 分享 UISearchController : NSObject 搜索视图控制器
UISearchBar : UIView 搜索条 UIAlertController : UIViewController 警告视图控制器 UIColor : NSObject 颜色 UIDevice : NSObject 设备信息 CMMotionManager : NSObject 加速度传感器 UIGestureRecognizer : NSObject 手势检测
UITapGestureRecognizer : UIGestureRecognizer 点击手势
UILongPressGestureRecognizer : UIGestureRecognizer 长按手势
UIRotationGestureRecognizer : UIGestureRecognizer 旋转手势
UIPinchGestureRecognizer : UIGestureRecognizer 捏合手势
UIPanGestureRecognizer : UIGestureRecognizer 拖动手势
UISwipeGestureRecognizer : UIGestureRecognizer 滑动手势 UITouch : NSObject 触摸 AudioServicesPlayAlertSound : 短频音效播放 AVAudioPlayer : NSObject 音频播放 MPMoviePlayerViewController : UIViewController 视频播放视图控制器
MPMoviePlayerController : NSObject 视频播放控件 AVPlayerViewController : UIViewController 音视频播放视图控制器
AVPlayer : NSObject 音视频播放控件

2、各控件功能说明

2.1 文字显示

2.2 进度显示

2.3 弹框提醒

2.4 滚动视图

2.5 内容选择

2.6 工具条

iOS - UIKit的更多相关文章

  1. iOS UIKit:viewController之动画(5)

    当弹出一个view controller时,UIKit提供了一些标准转换动画,并且也支持用户自定义的动画效果. 1 UIView动画 UIView是自带动画实现功能,其中有两种方式实现:        ...

  2. iOS UIKit:TableView之单元格配置(2)

    Table View是UITableView类的实例对象,其是使用节(section)来描述信息的一种滚动列表.但与普通的表格不同,tableView只有一行,且只能在垂直方向进行滚动.tableVi ...

  3. iOS UIKit:Navigation Controllers

    navigation controller是一种层次结构的container view controller,即其通过一个view controllers栈来管理内部的content view con ...

  4. iOS UIKit:viewController之定义(2)

    @import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/c ...

  5. iOS UIKit:viewController之层次结构(1)

    ViewController是iOS应用程序中重要的部分,是应用程序数据和视图之间的重要桥梁.且应用程序至少有一个view controller.每个view controller对象都负责和管理一个 ...

  6. iOS UIKit:view

    @import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css); @import url(/ ...

  7. iOS UIKit:App

    1.App生命周期 IOS架构是由许多设计模式实现,如model-view-controller 和 delegation模式. 1.1 main函数 与其它框架类似,IOS框架的入口也是从main函 ...

  8. ios UIKit动力

    UIkit动力学是UIkit框架中模拟真实世界的一些特性. UIDynamicAnimator 主要有UIDynamicAnimator类,通过这个类中的不同行为来实现一些动态特性. 它一般有两种初始 ...

  9. ios UIKit动力 分类: ios技术 2015-07-14 12:55 196人阅读 评论(0) 收藏

    UIkit动力学是UIkit框架中模拟真实世界的一些特性. UIDynamicAnimator 主要有UIDynamicAnimator类,通过这个类中的不同行为来实现一些动态特性. 它一般有两种初始 ...

  10. iOS UIKit Dynamics入门 UIKit动力学,实现重力、连接、碰撞、悬挂等动画效果

    本文为转载文章 版权归原文所有 什么是UIKit动力学(UIKit Dynamics) 其实就是UIKit的一套动画和交互体系.我们现在进行UI动画基本都是使用CoreAnimation或者UIVie ...

随机推荐

  1. php两种include加载文件方式效率比较如下

    1)定义一个字符串变量,里面保存要加载的文件列表.然后foreach加载. $a = '/a.class.php;/Util/b.class.php;/Util/c.class.php'; $b = ...

  2. CSS3 功能

    1.  CSS3在css2的基础上增加了很多功能,ie8以下的浏览器有可能不支持某些属性,增加了很多圆角.渐变.旋转.阴影等效果 2.  文本修饰 text-decoration 属性用来设置或删除文 ...

  3. snackbar初体验

    底部弹出的部分就是snackbar的,右侧可添加一个action响应点击事件,遗憾的时貌似只能添加一个 这是华为mate8上面运行出来的效果,颜色之类的都是默认.不同的android版本样式稍有差异 ...

  4. cocos2dx lua bug之module 'lsqlite3' not found

    05-27 15:41:01.360: D/cocos2d-x debug info(7261): [LUA-print] -------------------------------------- ...

  5. Spring AOP:面向切面编程,AspectJ,是基于注解的方法

    面向切面编程的术语: 切面(Aspect): 横切关注点(跨越应用程序多个模块的功能)被模块化的特殊对象 通知(Advice): 切面必须要完成的工作 目标(Target): 被通知的对象 代理(Pr ...

  6. 实现LUT

    //实现LUT 查找表 #include "stdafx.h" #include <iostream> #include <opencv2/opencv.hpp& ...

  7. wamp安装完更改关联浏览器

    "wampmanager.conf"文件修改的是关于中到官网的链接打开方式. "wampmanager.ini"修改的是左键菜单的打开方式. 修改完无效的话重启 ...

  8. 双击Button按钮后执行的函数

    在MFC中,当在用户界面拖入一个button后,双击会进入cpp文件,实现一个按钮点击的方法如: void CtestcontorlDlg::OnBnClickedButton() { : } 理解: ...

  9. 关于三星A7屏幕锁已由管理员、加密政策,或证书存储禁用

    解决办法:设定-安全-清除证书-再返回锁定屏幕-把密码锁定-改为滑动.....

  10. C#语法基础用法Dictionary排序

    Dictionary排序 1.先看效果图: 2.核心逻辑如下: Dictionary<int, string> list = new Dictionary<int, string&g ...