澳门威利斯人_威利斯人娱乐「手机版」

来自 网络资讯 2020-05-01 05:34 的文章
当前位置: 澳门威利斯人 > 网络资讯 > 正文

官方文档翻译

Most of the things you might want to do visually are donewith view objects—instances of the UIView class.A view object defines a rectangular region on the screen and handles thedrawing and touch events in that region. A view can also act as a parent forother views and coordinate the placement and sizing of those views. TheUIViewclass does most of thework in managing these relationships between views, but you can also customizethe default behavior as needed.

brief

Windows do not have any visible content themselves but provide a basic container for your application’s views

Views are responsible for

  • drawing content
    • Drawing involves using graphics technologies such as Core Graphics, OpenGL ES, or UIKit to draw shapes, images, and text inside a view’s rectangular area
  • handling multitouch events
    • A view responds to touch events in its rectangular area either by using gesture recognizers or by handling touch events directly
  • managing the layout of any subviews.
    • In the view hierarchy, parent views are responsible for positioning and sizing their child views and can do so dynamically

非常多你或然想要做的可视化是由视图对象达成的——及UIView类的实例。视图对象在荧屏上定义了一个矩形区域,并在该区域内部管理理绘图和触摸事件。视图也足以当做其余视图的父视图,并为这一个视图定位和定尺寸。UIView类的大多做事是管制这一个视图间关系,你也足以依附必要自定义暗中同意行为。

view Architecture

Views work in conjunction with Core Animation layers to handle the rendering and animating of a view’s content. Every view in UIKit is backed by a layer object (usually an instance of the CALayer class), which manages the backing store for the view and handles view-related animations. Most operations you perform should be through the UIView interface. However, in situations where you need more control over the rendering or animation behavior of your view, you can perform operations through its layer instead.

Every view has a corresponding layer object that can be accessed from that view’s layer property. (Because a bar button item is not a view, you cannot access its layer directly.) Behind those layer objects are Core Animation rendering objects and ultimately the hardware buffers used to manage the actual bits on the screen

图片 1

view-layer

The use of Core Animation layer objects has important implications for performance. The actual drawing code of a view object is called as little as possible, and when the code is called, the results are cached by Core Animation and reused as much as possible later. Reusing already-rendered content eliminates the expensive drawing cycle usually needed to update views. Reuse of this content is especially important during animations, where the existing content can be manipulated. Such reuse is much less expensive than creating new content.

Views work in conjunction with Core Animation layers tohandle the rendering and animating of a view’s content.Every view in UIKit is backed by a layer object (usually an instance of theCALayerclass), which manages the backing store for the view and handles view-related animations.Mostoperations you perform should be through theUIViewinterface. However, insituations where you need more control over the rendering or animation behaviorof your view, you can perform operations through its layer instead.

View Hierarchies and Subview Management

Each superview stores its subviews in an ordered array and the order in that array also affects the visibility of each subview.

The arrangement of views in a view hierarchy also determines how your application responds to events. When a touch occurs inside a specific view, the system sends an event object with the touch information directly to that view for handling. However, if the view does not handle a particular touch event, it can pass the event object along to its superview. If the superview does not handle the event, it passes the event object to its superview, and so on up the responder chain. Specific views can also pass the event object to an intervening responder object, such as a view controller. If no object handles the event, it eventually reaches the application object, which generally discards it.

视图结合内核动漫(Core Animation卡塔尔层一齐,来管理视图内容的渲染和卡通片。通过二个层对象(平日是CALayer类的贰个实例卡塔尔国,在UIKit框架里的每一个视图都辅助管理视图的后台存款和储蓄和拍卖视图相关的各个卡通。你试行的半数以上操作应该依附UIView接口。但是,在你要求更加多的调节关于渲染(rendering)或动漫视图的一颦一笑的景观下,你能够试行操作它的层来替代。

The View Drawing Cycle

The UIView class uses an on-demand drawing model for presenting content. When a view first appears on the screen, the system asks it to draw its content. The system captures a snapshot of this content and uses that snapshot as the view’s visual representation. If you never change the view’s content, the view’s drawing code may never be called again. The snapshot image is reused for most operations involving the view. If you do change the content, you notify the system that the view has changed. The view then repeats the process of drawing the view and capturing a snapshot of the new results.

When the contents of your view change, you do not redraw those changes directly. Instead, you invalidate the view using either the setNeedsDisplay or setNeedsDisplayInRect: method. These methods tell the system that the contents of the view changed and need to be redrawn at the next opportunity. The system waits until the end of the current run loop before initiating any drawing operations. This delay gives you a chance to invalidate multiple views, add or remove views from your hierarchy, hide views, resize views, and reposition views all at once. All of the changes you make are then reflected at the same time.

Changing a view’s geometry does not automatically cause the system to redraw the view’s content. The view’s contentMode property determines how changes to the view’s geometry are interpreted. Most content modes stretch or reposition the existing snapshot within the view’s boundaries and do not create a new one. For more information about how content modes affect the drawing cycle of your view

When the time comes to render your view’s content, the actual drawing process varies depending on the view and its configuration. System views typically implement private drawing methods to render their content. Those same system views often expose interfaces that you can use to configure the view’s actual appearance. For custom UIView subclasses, you typically override the drawRect: method of your view and use that method to draw your view’s content. There are also other ways to provide a view’s content, such as setting the contents of the underlying layer directly, but overriding the drawRect: method is the most common technique.

To understand the relationship between views and layers, ithelps to look at an example.Figure 1-1showsthe view architecture from the ViewTransitions sample application along withthe relationship to the underlying Core Animation layers. The views in theapplication include a window (which is also a view), a genericUIViewobject that acts as acontainer view, an image view, a toolbar for displaying controls, and a barbutton item (which is not a view itself but which manages a view internally).(The actual ViewTransitions sample application includes anadditional image view that is used to implement transitions. For simplicity,and because that view is usually hidden, it is not included inFigure 1-1.) Every view has a corresponding layerobject that can be accessed from that view’s layer property.(Because a bar button item is not a view, you cannot access its layerdirectly.) Behind those layer objects are Core Animation rendering objects andultimately the hardware buffers used to manage the actual bits on the screen.

Content Modes

Each view has a content mode that controls how the view recycles its content in response to changes in the view’s geometry and whether it recycles its content at all. When a view is first displayed, it renders its content as usual and the results are captured in an underlying bitmap. After that, changes to the view’s geometry do not always cause the bitmap to be recreated. Instead, the value in the contentMode property determines whether the bitmap should be scaled to fit the new bounds or simply pinned to one corner or edge of the view.

图片 2

scale_aspect.jpg

The content mode of a view is applied whenever you do the following:

  • Change the width or height of the view’s frame or bounds rectangles.
  • Assign a transform that includes a scaling factor to the view’s transform property.

By default, the contentMode property for most views is set to UIViewContentModeScaleToFill

you can also set the content mode to the UIViewContentModeRedraw value when you specifically want your custom views to redraw themselves during scaling and resizing operations. Setting your view’s content mode to this value forces the system to call your view’s drawRect: method in response to geometry changes. In general, you should avoid using this value whenever possible, and you should certainly not use it with the standard system views

为了通晓视图和层之间的关系,看个例子更有帮助。图1-1体现了ViewTransitions演示应用中的视图布局,以致跟底层的基石动漫层之间的关联。应用中的视图包涵三个窗口,叁个通用的UIView对象,它充当容器视图(container view卡塔尔,一个图像视图,用于显示控件的工具栏,和三个工具栏按键项(它本人不是三个视图,不过在内处了多少个视图卡塔尔。(实际的ViewTransitions演示应用还隐含叁个额外的图像视图,用来落实联网(transitions)。因为非常视图平日是藏身的,为简易起见没包蕴在图1-1里卡塔尔(قطر‎每二个视图都有一个对应的层对象,能够从该视图的layer属性访谈。(因为工具栏按键项不是三个视图,你不可能间接待上访谈它的层State of Qatar那些层对象的背后是内核动漫渲染对象,最后硬件缓存(hardware buffers)用来管理显示器上的莫过于位。

Stretchable Views

图片 3

button_scale.jpg

You specify the stretchable area of a view using the contentStretch property.
The view’s content mode also plays a role in determining how the view’s stretchable area is used.Stretchable areas are only used when the content mode would cause the view’s content to be scaled. This means that stretchable views are supported only with the UIViewContentModeScaleToFill, UIViewContentModeScaleAspectFit, and UIViewContentModeScaleAspectFill content modes. If you specify a content mode that pins the content to an edge or corner (and thus does not actually scale the content), the view ignores the stretchable area.

Note: The use of the contentStretch property is recommended over the creation of a stretchable UIImage object when specifying the background for a view. Stretchable views are handled entirely in the Core Animation layer, which typically offers better performance.

Figure 1-1Architecture of the views in a sample application

Built-In Animation Support

frame—Use this to animate position and size changes for the view.
bounds—Use this to animate changes to the size of the view.
center—Use this to animate the position of the view.
transform—Use this to rotate or scale the view.
alpha—Use this to change the transparency of the view.
backgroundColor—Use this to change the background color of the view.
contentStretch—Use this to change how the view’s contents stretch.

图片 4

View Geometry and Coordinate Systems

The default coordinate system in UIKit has its origin in the top-left corner and has axes that extend down and to the right from the origin point.

Important: Some iOS technologies define default coordinate systems whose origin point and orientation differ from those used by UIKit. For example, Core Graphics and OpenGL ES use a coordinate system whose origin lies in the lower-left corner of the view or window and whose y-axis points upward relative to the screen. Your code must take such differences into account when drawing or creating content and adjust coordinate values (or the default orientation of the coordinate system) as needed.

The use of Core Animation layer objects has importantimplications for performance. The actual drawing code of a view object iscalled as little as possible, and when the code is called, the results arecached by Core Animation and reused as much as possible later. Reusingalready-rendered content eliminates the expensive drawing cycle usually neededto update views.Reuse of this content is especially important during animations, where the existing content can be manipulated.Suchreuse is much less expensive than creating new content.

The Relationship of the Frame, Bounds, and Center Properties

  • The frame property contains the frame rectangle, which specifies the size and location of the view in its superview’s coordinate system.
  • The bounds property contains the bounds rectangle, which specifies the size of the view (and its content origin) in the view’s own local coordinate system.
  • The center property contains the known center point of the view in the superview’s coordinate system.

If you are changing only the position of the view (and not its size), the center property is the preferred way to do so. The value in the center property is always valid, even if scaling or rotation factors have been added to the view’s transform. The same is not true for the value in the frame property, which is considered invalid if the view’s transform is not equal to the identity transform.

By default, a view’s frame is not clipped to its superview’s frame. Thus, any subviews that lie outside of their superview’s frame are rendered in their entirety. You can change this behavior, though, by setting the superview’s clipsToBounds property to YES. Regardless of whether or not subviews are clipped visually, touch events always respect the bounds rectangle of the target view’s superview. In other words, touch events occurring in a part of a view that lies outside of its superview’s bounds rectangle are not delivered to that view.

内核动漫层对象的施用对品质有很主要的意义。视图的对象的实际上绘图代码会被尽只怕少的调用,现代码被调用时,结果通过根底动漫缓存,并在今后尽量多的任用。重用已经被渲染的内容减少了家常要求改革视图的高昂的绘图周期。在动漫时那个存在的内容能被操作,并且以此内容的录取是更为注重的。那样的选定比成立新剧情省去消耗。

Coordinate System Transformations

  • To modify your entire view, modify the affine transform in the transform property of your view.
  • To modify specific pieces of content in your view’s drawRect: method, modify the affine transform associated with the active graphics context.

You would not use this property to make permanent changes to your view, such as modifying its position or size a view within its superview’s coordinate space. For that type of change, you should modify the frame rectangle of your view instead.
Note: When modifying the transform property of your view, all transformations are performed relative to the center point of the view.

In your view’s drawRect: method, you use affine transforms to position and orient the items you plan to draw. Rather than fix the position of an object at some location in your view, it is simpler to create each object relative to a fixed point, typically (0, 0), and use a transform to position the object immediately prior to drawing. That way, if the position of the object changes in your view, all you have to do is modify the transform, which is much faster and less expensive than recreating the object at its new location. You can retrieve the affine transform associated with a graphics context using the CGContextGetCTM function and you can use the related Core Graphics functions to set or modify this transform during drawing.(i don't quiet understand)

Important: If a view’s transform property is not the identity transform, the value of that view’s frame property is undefined and must be ignored. When applying transforms to a view, you must use the view’s bounds and center properties to get the size and position of the view. The frame rectangles of any subviews are still valid because they are relative to the view’s bounds.

In addition to providing its own content, a view can act asa container for other views. When one view contains another, a parent-childrelationship is created between the two views. The child view in therelationship is known as the subview and the parent view is known asthe superview. The creation of this type of relationship has implicationsfor both the visual appearance of your application and the application’s behavior.

Points Versus Pixels

One point does not necessarily correspond to one pixel on the screen.

图片 5

At the device level, all coordinates you specify in your view must be converted to pixels at some point. However, the mapping of points in the user coordinate space to pixels in the device coordinate space is normally handled by the system. Both UIKit and Core Graphics use a primarily vector-based drawing model where all coordinate values are specified using points. Thus, if you draw a curve using Core Graphics, you specify the curve using the same values, regardless of the resolution of the underlying screen.

而外提供它本人的剧情,视图还可以充任此外视图的器皿。当一个视图包括了另二个时,在这里三个视图之间就创立了父亲和儿子关系。在这里个关系中的子视图平日被称为子视图,而父视图则被称作superview。那连串型的关系的创办对于你利用的可视化外观和接纳的行事都有早晚的震慑。

The Runtime Interaction Model for Views

Any time a user interacts with your user interface, or any time your own code programmatically changes something, a complex sequence of events takes place inside of UIKit to handle that interaction. At specific points during that sequence, UIKit calls out to your view classes and gives them a chance to respond on behalf of your application.

图片 6

UIKit interactions with your view objects

The following steps break the event sequence in Figure 1-7 down even further and explain what happens at each stage and how you might want your application to react in response.

  1. The user touches the screen.
  2. The hardware reports the touch event to the UIKit framework.
  3. The UIKit framework packages the touch into a UIEvent object and dispatches it to the appropriate view. (For a detailed explanation of how UIKit delivers events to your views, see Event Handling Guide for iOS.)
  4. The event-handling code of your view responds to the event. For example, your code might:
  • Change the properties (frame, bounds, alpha, and so on) of the view or its subviews.
  • Call the setNeedsLayout method to mark the view (or its subviews) as needing a layout update.
  • Call the setNeedsDisplay or setNeedsDisplayInRect: method to mark the view (or its subviews) as needing to be redrawn.
  • Notify a controller about changes to some piece of data.

Of course, it is up to you to decide which of these things the view should do and which methods it should call.

  1. If the geometry of a view changed for any reason, UIKit updates its subviews according to the following rules:
    a. If you have configured autoresizing rules for your views, UIKit adjusts each view according to those rules. For more information about how autoresizing rules work, see Handling Layout Changes Automatically Using Autoresizing Rules.

b. If the view implements the layoutSubviews method, UIKit calls it.You can override this method in your custom views and use it to adjust the position and size of any subviews. For example, a view that provides a large scrollable area would need to use several subviews as “tiles” rather than create one large view, which is not likely to fit in memory anyway. In its implementation of this method, the view would hide any subviews that are now offscreen or reposition them and use them to draw newly exposed content. As part of this process, the view’s layout code can also invalidate any views that need to be redrawn.

  1. If any part of any view was marked as needing to be redrawn, UIKit asks the view to redraw itself.For custom views that explicitly define a drawRect: method, UIKit calls that method. Your implementation of this method should redraw the specified area of the view as quickly as possible and nothing else. Do not make additional layout changes at this point and do not make other changes to your application’s data model. The purpose of this method is to update the visual content of your view.Standard system views typically do not implement a drawRect: method but instead manage their drawing at this time.
  2. Any updated views are composited with the rest of the application’s visible content and sent to the graphics hardware for display.
  3. The graphics hardware transfers the rendered content to the screen.

Note: The preceding update model applies primarily to applications that use standard system views and drawing techniques. Applications that use OpenGL ES for drawing typically configure a single full-screen view and draw directly to the associated OpenGL ES graphics context. In such a case, the view may still handle touch events but, because it is full-
screen, it would not need to lay out subviews.

Visually, the content of a subview obscures all or part ofthe content of its parent view. If the subview is totally opaque, then the areaoccupied by the subview completely obscures the corresponding area of theparent. If the subview is partially transparent, the content from the two viewsis blended together prior to being displayed on the screen. Each superviewstores its subviews in an ordered array and the order in that array alsoaffects the visibility of each subview. If two sibling subviews overlap eachother, the one that was added last (or was moved to the end of the subviewarray) appears on top of the other.

Tips for Using Views Effectively

  • Views Do Not Always Have a Corresponding View Controller
  • Minimize Custom Drawing
  • Take Advantage of Content Modes
  • Declare Views as Opaque Whenever Possible
  • Adjust Your View’s Drawing Behavior When Scrolling
  • Do Not Customize Controls by Embedding Subviews

在视觉上,子视图的源委掩瞒了上上下下或部分它的父视图的内容。假诺子视图是完全不透明的,则子视图并吞的区域完全覆盖了父视图的照顾区域。假如子视图部分透明的,则四个视图的剧情在呈现到显示器上事情发生在此之前被混合在联合签字。各个父视图把它们的子视图遵照一定顺序存在一个数组里,该每个也影响了每种子视图的可以知道性。假设三个弟兄子视图互相重叠,则后加(或被移到子视图数组的末段的卡塔尔国的视图展现在前三个视图的上面。

The superview-subview relationship also impacts severalview behaviors. Changing the size of a parent view has a ripple effect that cancause the size and position of any subviews to change too. When you change thesize of a parent view, you can control the resizing behavior of each subview byconfiguring the view appropriately. Other changes that affect subviews includehiding a superview, changing a superview’s alpha (transparency), or applying amathematical transform to a superview’s coordinate system.

父亲和儿子视图关系也潜濡默化了一部分视图行为。改革父视图的尺寸会时有产生四个连锁反应,引致子视图的尺寸和任务也时有产生转移。当您改造父视图的尺码时,通过适本地配置那几个视图,你可以看到调整每种子视图调度大小的行为(resizing behavior卡塔尔国。此外影响子视图的更正还包蕴隐形父视图,改造父视图的阿尔法值,或给父视图的坐标种类利用多个数学调换。

The arrangement of views in a view hierarchy alsodetermines how your application responds to events. When a touch occurs insidea specific view, the system sends an event object with the touch informationdirectly to that view for handling. However, if the view does not handle aparticular touch event, it can pass the event object along to its superview. Ifthe superview does not handle the event, it passes the event object to itssuperview, and so on up the responder chain. Specific views can also pass theevent object to an interveningresponder object,such as a view controller. If no object handles the event, it eventuallyreaches the application object, which generally discards it.

视图在视图等级次序里的排列也调整了应用程序怎么样对事件做出响应。当触摸发生在二个一定视图内部时,系统间接发送二个具备触摸音讯的平地风波目的让其处理。然则,若是该视图未有拍卖特定的触摸事件,它可以向前传递事件指标到它的父视图。如果它的父视图还不曾拍卖该事件,则把事件传递给父视图的父视图,如此这般逐级进步响应链。特定视图也得以传递事件指标给多少个介怀中间的响应对象,例如二个视图调节器。如果未有对象管理该事件,它聊到底会被传送到应用程序对象,平常由应用程序对象把它废弃。

For more information about how to create view hierarchies,see“Creating and Managing a View Hierarchy.”

至于如何创立视图等级次序的越多音信,请看“Creating and Managing a View Hierarchy.”

TheUIViewclassuses an on-demand drawing model for presenting content. When a view firstappears on the screen, the system asks it to draw its content. The systemcaptures a snapshot of this content and uses that snapshot as the view’s visualrepresentation. If you never change the view’s content, the view’s drawing codemay never be called again. The snapshot image is reused for most operationsinvolving the view. If you do change the content, you notify the system thatthe view has changed. The view then repeats the process of drawing the view andcapturing a snapshot of the new results.

UIView类使用一种按需绘制模型(on-demand drawing modelState of Qatar来表现视图内容。当视图第三次出以往显示屏上时,系统必要它绘制其故事情节。系统捕捉该内容的快速照相,并利用该快速照相作为视图的视觉彰显(visual representationState of Qatar。借使您或多或少也未有改正视图的剧情,那视图的绘图代码大概不会再被调用。快速照相图片被波及视图的大多数操作所接收。借使您对剧情做了更动,你须要文告系统告知它视图已经改造。然后视图重复绘制视图进度,并捕捉新的快速照相。

When the contents of your view change, you do not redrawthose changes directly. Instead, you invalidate the view using either the setNeedsDisplay or setNeedsDisplayInRect:method.These methods tell the system that the contents of the view changed and need tobe redrawn at the next opportunity. The system waits until the end of thecurrent run loop before initiating any drawing operations. This delay gives youa chance to invalidate multiple views, add or remove views from your hierarchy,hide views, resize views, and reposition views all at once. All of the changesyou make are then reflected at the same time.

当你的视图内容产生退换时,你不会一贯重新绘制这些改变。你可以用setNeedsDisplay或setNeedsDisplayInRect:方法让视图无效。那几个格局告诉系统视图的内容已经产生改动,须要在下一次再度绘制。该系统在运转任何绘图操作此前,等待眼下运作循环的终结。该延时给你二次时机,用来二遍性完结吐弃四个视图,从视图档期的顺序里增进或删除视图,隐蔽视图,调节视图大小,重新配置视图等。全体那一个你做的变动就要同时反映出来。

Note: Changinga view’s geometry does not automatically cause the system to redraw the view’scontent. The view’scontentModepropertydetermines how changes to the view’s geometry are interpreted. Most contentmodes stretch or reposition the existing snapshot within the view’s boundariesand do not create a new one. For more information about how content modesaffect the drawing cycle of your view, see“Content Modes.”

在乎:改动视图的几何构造并不会自动招致系统重画视图内容。视图的contentMode属性鲜明了哪些转移视图的几何解释。大好些个内容形式都以在视图边界里拉伸或重新配置已经存在的快照,并不供给创立新视图内容。掌握越多关于内容方式怎么着影响视图的绘图周期,请看“Content Modes.”

When the time comes to render your view’s content, the actual drawing process varies depending on the view and its configuration. System views typically implement private drawing methods to render their content. Those same system views often expose interfaces that you can use to configure the view’s actual appearance. For customUIViewsubclasses, you typicallyoverride the drawRect:method of your view and use that method to draw yourview’s content. There are also other ways to provide a view’s content, such assetting the contents of the underlying layer directly, but overriding thedrawRect:method is the mostcommon technique.

当开端渲染视图内容时,实际的绘图进度依据视图和它的配备而退换。系统视图平常试行私有绘图方法来渲染它们的从头到尾的经过。这一个相像的体系视图日常暴揭穿接口,令你能够用来安插视图实际的外观。为了定制UIView子类,你日常重载视图的drawRect:方法,并用该办法绘制视图的内容。还会有别的方法来提供一个视图的剧情,比方直接设置底层内容,可是重载drawRect:方法是最通用的技术。

For more information about how to draw content for customviews, see“Implementing Your Drawing Code.”

越来越多关于怎么样绘制自定义视图的内容方面包车型大巴音讯,请看“Implementing Your Drawing Code.”

Each view has a content mode that controls how the viewrecycles its content in response to changes in the view’s geometry and whetherit recycles its content at all. When a view is first displayed, it renders itscontent as usual and the results are captured in an underlying bitmap. Afterthat, changes to the view’s geometry do not always cause the bitmap to berecreated. Instead, the value in thecontentModepropertydetermines whether the bitmap should be scaled to fit the new bounds or simplypinned to one corner or edge of the view.

各样视图皆有二个内容情势(content model),在视图几何外形发生变化时,用来支配视图如何回收聘用它的剧情来响应视图几何外形的转移,以至是不是回收重用其全体内容。当视图被第三回展现时,它跟日常一律渲染它的内容,何况结果被抓走到一个尾部位图里。然后,视图几何外形的改观并不总是变成重新创设位图。相反,contentMode属性的值决定了该位图是或不是应该缩放来适应新的疆界,或只须要轻便的定位到视图的叁个角落或一边。

The content mode of a view is applied whenever you do thefollowing:

视图的剧情情势被应用到以下情况:

·Change the width or height ofthe view’sframeorboundsrectangles.

校正视图框架或矩形边界(frameorbounds卡塔尔的长短或宽度。

·Assign a transform thatincludes a scaling factor to the view’stransformproperty.

给视图transform的质量分配多少个转变,该调换满含三个缩放因子。

By default, thecontentModeproperty for most views is set to UIViewContentModeScaleToFill,which causes the view’s contents to be scaled to fit the new frame size.Figure 1-2shows the results that occur for somecontent modes that are available. As you can see from the figure, not allcontent modes result in the view’s bounds being filled entirely, and those thatdo might distort the view’s content.

暗许时,大好些个视图的开始和结果情势属性被设为UIViewContentModeScaleToFill,该装置招致视图的内容被缩放以适应新的框架尺寸。图1-2显示了一部分可用的源委格局作用。正如您在图中阅览,不是独具的内容形式招致视图边界被全然填满,而且那多个真正填满边界的图片可能走样。

Figure 1-2 Content mode comparisons

图1-2内容情势相比

图片 7

本文由澳门威利斯人发布于网络资讯,转载请注明出处:官方文档翻译

关键词: 澳门威利斯人 日记本 文档 官方 Guide