CALayer描述及本人翻譯

The CALayer class manages image-based content and allows you to perform animations on that content. Layers are often used to provide the backing store for views but can also be used without a view to display content. A layer’s main job is to manage the visual content that you provide but the layer itself has visual attributes that can be set, such as a background color, border, and shadow. In addition to managing visual content, the layer also maintains information about the geometry of its content (such as its position, size, and transform) that is used to present that content onscreen. Modifying the properties of the layer is how you initiate animations on the layer’s content or geometry. A layer object encapsulates the duration and pacing of a layer and its animations by adopting the CAMediaTiming protocol, which defines the layer’s timing information.

If the layer object was created by a view, the view typically assigns itself as the layer’s delegate automatically, and you should not change that relationship. For layers you create yourself, you can assign a delegate object and use that object to provide the contents of the layer dynamically and perform other tasks. A layer may also have a layout manager object (assigned to the layoutManager property) to manage the layout of subviews separately.

翻譯:CALayer類管理以圖片為基準(zhǔn)的內(nèi)容并且允許你去在內(nèi)容上展示動畫.圖層面板(Layers)通常用來提供后臺存儲視圖并且也可以不通過視圖展示內(nèi)容.圖層面板(Layer)的主要工作是去管理那些你提供的可視的內(nèi)容,但圖層自身可以設(shè)置可視化屬性,例如背景顏色,邊界和陰影.為了管理可視化內(nèi)容,圖層也保留內(nèi)容的幾何形狀信息(例如位置,尺寸,和形變)用來在屏幕上顯現(xiàn)內(nèi)容.修改圖層的屬性在于怎樣啟動圖層內(nèi)容或幾何形狀的動畫.一個圖層對象通過采用CAMediaTiming協(xié)議,該協(xié)議定義了圖層的定時信息并且封裝了圖層的持續(xù)時間和調(diào)步以及動畫.如果圖層對象通過視圖創(chuàng)建,視圖通常自動分配自身作為圖層的代理人并且你不應(yīng)該改變這種關(guān)系.對于自己創(chuàng)建的圖層,你可以指定一個委托對象,并使用該對象來動態(tài)地提供圖層的內(nèi)容以及執(zhí)行其他任務(wù)。圖層也可以有布局管理對象(指定布局管理屬性)去分別管理子視圖的布局.

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 一天之內(nèi),印象最深刻: 出門遇到的第一個大叔,每天認(rèn)真的記錄違規(guī)車輛,他鼻梁上的眼鏡,每每都想讓我扶正。 然后第一...
    木易有心閱讀 454評論 0 2
  • 你在外地打工, 她在家鄉(xiāng)上班。 你在外地寫詩, 她在家鄉(xiāng)繪畫。
    小劇在成長閱讀 151評論 2 4
  • 堅持了兩天沒給孩子手機(jī),昨天晚上他有點反復(fù),回家就問他爸爸要手機(jī)。說要找他的小老師有事,給了他手機(jī)。他開始寫閱讀筆...
    kitcui閱讀 162評論 0 1
  • 很喜歡畫畫,之前一直沒機(jī)會,偶然在簡書上看到鈴鐺子老師的訓(xùn)練營,想了好久才報名的!可惜還是錯過了前兩期,本次作業(yè)...
    來自遠(yuǎn)方的豬閱讀 326評論 10 3

友情鏈接更多精彩內(nèi)容