IT English Collection(19)of View object

来源:互联网 发布:旋风 for mac 编辑:程序博客网 时间:2024/06/06 04:22

1 前言

本章主要介绍了View视图对象,包括了其属性,视图间关系和CALayer的简介。

2 详述

2.1 原文

A view is an object that draws itself within arectangular area of a window and that can respond to user actions such as finger taps or mouse clicks. A view draws a visualrepresentation of itself andpresents a surface that responds to touches and input from devices. Not all views handle events, but views are more likely to handle events than other types of responder objects (that is, objectscapable of responding to events). Views also provide the content for printing. For a view to be useful, it must besituated in the view hierarchy of a window.
Views inherit, directly or indirectly, from NSView in Mac OSX or from UIView in iOS. These classes perform no drawing or event-handling themselves, but provide the interface andinfrastructure for subclasses. The AppKit and UIKit frameworks provide almost all views that you see in an application’s window, including buttons, table views, text fields, toolbars, and sliders. These views are available to your project in the Interface Builder library. You can also subclass UIView or NSView and create custom views that draw themselves and handle events indistinctive ways.


The Core Properties of Views


Views in both the UIKit and AppKit frameworks have important characteristics defined by a handful of properties:
·View boundary and placement. The frame and bounds of a view define its boundaries and its relationships to other views. The framespecifies the placement and size of a view within its superview’s coordinate system; the bounds of a view specifies the local coordinate system that a view uses for drawing itself. (Views in UIKit also have a property that locates the center of their rectangular area.)
·Relationship to other views. The superview, subview, and window properties specify a view’s place in the view hierarchy of its window. You add views (subviews) toenclosing views (superviews) to createcompound views and, ultimately, to create a user interface. An autoresizing property specifies how a view’s subviews position and resize themselves when the enclosing view itself is resized.


Views Are Inherently Capable of Animation


In both iOS and OS X, each view is (or can be)backed by a Core Animation layer object (CALayer), which isaccessible through the layer property. The layer object caches a view’s drawing content,assists in the layout andrendering of that content, and can composite and animate that content. Certain properties of a view, such as the view’s frame and itsopacity, areimplicitly capable of animation.In addition, an application mayexplicitly animate a view using facilities of the Core Animation framework.
In OS X, CALayer-support is optional whereas in iOS this support is built into each view’s rendering implementation.

2.2 生词

rectangular[rek'tæŋgjʊlə]adj. 矩形的;成直角的

representation[,reprɪzen'teɪʃ(ə)n]n.代表;表现

presents[ˈpreznts]v. 显示(present的单三形式);出席

surface['sɜːfɪs]n. 表面;表层;外观

capable['keɪpəb(ə)l]adj. 能干的,能胜任的;

situated['sɪtjʊeɪtɪd]adj. 位于…的;处于…境遇的

inherit[ɪn'herɪt]vt. 继承;遗传而得

infrastructure['ɪnfrəstrʌktʃə]n.基础设施;

distinctive[dɪ'stɪŋ(k)tɪv]adj. 有特色的,与众不同的

boundary['baʊnd(ə)rɪ]n.边界;范围;

placement['pleɪsmənt]n. 布置;定位球;人员配置

specifies[spesifais]n.指定

enclosingv.封闭;围合

compound['kɒmpaʊnd]vt.合成;混合;

ultimately['ʌltɪmətlɪ]adv. 最后;根本;基本上

backed by依靠;在…支持/掩护/配合下

accessible[ək'sesɪb(ə)l]adj. 易接近的;可进入的;可理解的

assists[ə'sists]v. 帮助;促进(assist的三单形式)

rendering['rend(ə)rɪŋ]n. 翻译;表现;表演;描写;打底;(建筑物等)透视图

composite['kɒmpəzɪt]vt. 使合成;使混合

animate['ænɪmeɪt]vt. 使有生气;使活泼;鼓舞;推动

opacity[ə(ʊ)'pæsɪtɪ]n.不透明;不传导

implicitly[ɪm'plɪsɪtlɪ]adv.含蓄地;暗中地

in addition另外,此外

explicitly[ik'splisitli]adv.明确地;明白地

facilities[fə'sɪlɪtɪz]n.设施;工具,设备

3 结语

    以上是所有内容,希望对大家有所帮助。

原创粉丝点击