久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <i id='p8Pqr'><tr id='p8Pqr'><dt id='p8Pqr'><q id='p8Pqr'><span id='p8Pqr'><b id='p8Pqr'><form id='p8Pqr'><ins id='p8Pqr'></ins><ul id='p8Pqr'></ul><sub id='p8Pqr'></sub></form><legend id='p8Pqr'></legend><bdo id='p8Pqr'><pre id='p8Pqr'><center id='p8Pqr'></center></pre></bdo></b><th id='p8Pqr'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='p8Pqr'><tfoot id='p8Pqr'></tfoot><dl id='p8Pqr'><fieldset id='p8Pqr'></fieldset></dl></div>
  • <tfoot id='p8Pqr'></tfoot>

      <bdo id='p8Pqr'></bdo><ul id='p8Pqr'></ul>
    <legend id='p8Pqr'><style id='p8Pqr'><dir id='p8Pqr'><q id='p8Pqr'></q></dir></style></legend>

    <small id='p8Pqr'></small><noframes id='p8Pqr'>

        UIEdgeInsetsMake 是如何工作的?

        How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)

          1. <small id='GA4gh'></small><noframes id='GA4gh'>

            • <legend id='GA4gh'><style id='GA4gh'><dir id='GA4gh'><q id='GA4gh'></q></dir></style></legend>

            • <tfoot id='GA4gh'></tfoot>

                  <bdo id='GA4gh'></bdo><ul id='GA4gh'></ul>
                    <tbody id='GA4gh'></tbody>
                • <i id='GA4gh'><tr id='GA4gh'><dt id='GA4gh'><q id='GA4gh'><span id='GA4gh'><b id='GA4gh'><form id='GA4gh'><ins id='GA4gh'></ins><ul id='GA4gh'></ul><sub id='GA4gh'></sub></form><legend id='GA4gh'></legend><bdo id='GA4gh'><pre id='GA4gh'><center id='GA4gh'></center></pre></bdo></b><th id='GA4gh'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='GA4gh'><tfoot id='GA4gh'></tfoot><dl id='GA4gh'><fieldset id='GA4gh'></fieldset></dl></div>
                  本文介紹了UIEdgeInsetsMake 是如何工作的?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在制作一個應用程序,我將 UIEdgeInsetsMake 用于 resizableImageWithCapInsets,但我不明白它是如何工作的,UIEdgeInsetsMake有 4 個參數:

                  I'm making an app where I use UIEdgeInsetsMake for resizableImageWithCapInsets, but I don't understand how does it works exactly, UIEdgeInsetsMake has 4 arguments:

                  • 頂部
                  • 底部

                  但它們是浮動的,所以我不知道如何將其設置為圖像,謝謝!:D

                  But they're floats so I don't know how to set that to an image, thanks! :D

                  推薦答案

                  根據文檔:

                  您可以使用此方法向圖像添加大寫插圖或更改圖像的現有大寫插圖.在這兩種情況下,您都會取回一張新圖像,而原始圖像保持不變.

                  You use this method to add cap insets to an image or to change the existing cap insets of an image. In both cases, you get back a new image and the original image remains untouched.

                  在圖像縮放或調整大小期間,被帽子覆蓋的區域不會被縮放或調整大小.相反,每個方向上未被帽覆蓋的像素區域從左到右和從上到下平鋪,以調整圖像大小.這種技術通常用于創建可變寬度按鈕,這些按鈕保留相同的圓角,但其中心區域會根據需要增大或縮小.為獲得最佳性能,請使用大小為 1x1 像素的平鋪區域.

                  During scaling or resizing of the image, areas covered by a cap are not scaled or resized. Instead, the pixel area not covered by the cap in each direction is tiled, left-to-right and top-to-bottom, to resize the image. This technique is often used to create variable-width buttons, which retain the same rounded corners but whose center region grows or shrinks as needed. For best performance, use a tiled area that is a 1x1 pixel area in size.

                  所以您只需要在 UIEdgeInsetsMake 函數的值中使用您想要使其不可拉伸的像素數量.

                  So you only need to use the amount of pixels you want to make unstretchable in the values of the UIEdgeInsetsMake function.

                  假設您有一張 21x50 點的圖像(標準清晰度為 21x50 像素,Retina @2x"清晰度為 42x100 像素)并希望此圖像可水平拉伸,保持左右 10 個點不變拉伸圖像時,但僅拉伸中間 1 點寬的帶.然后你將使用 UIEdgeInsetsMake(0,10,0,10).

                  Say you have an image of 21x50 points (21x50 pixels in standard definition, 42x100 pixels in Retina "@2x" definition) and want this image to be horizontally stretchable, keeping the 10 points on the left and on the right untouched when stretching the image, but only stretch the 1-point-wide band in the middle. Then you will use UIEdgeInsetsMake(0,10,0,10).

                  不要擔心它們是浮點數(例如,這對于亞像素調整大小很有用,但實際上您可能只會使用整數(或沒有小數部分的浮點數)

                  Don't bother that they are floats (that's useful for subpixelling resizing for example, but in practice you will probably only use integers (or floats with no decimal parts)

                  注意,這是 iOS5+ 獨有的方法,iOS5 之前不可用.如果您使用 iOS5 之前的 SDK,請改用 stretchableImageWithLeftCapWidth:topCapHeight:.

                  Be careful, this is an iOS5+ only method, not available prior iOS5. If you use pre-iOS5 SDK, use stretchableImageWithLeftCapWidth:topCapHeight: instead.

                  一些提示我使用了一段時間,因為我不記得 UIEdgeInsets 結構的字段的順序是什么 - 以及我們應該以什么順序將參數傳遞給 UIEdgeInsetsMake 函數 — 我更喜歡使用 指定初始化"語法如下:

                  Some tip I use since some time, as I never remember in which order the fields of the UIEdgeInsets structure are — and in which order we are supposed to pass the arguments to UIEdgeInsetsMake function — I prefer using the "designated inits" syntax like this:

                  UIEdgeInsets insets = { .left = 50, .right = 50, .top = 10, .bottom = 10 };
                  

                  或者當需要顯式轉換時:

                  Or when an explicit cast is needed:

                  UIImage* rzImg = [image resizableImageWithCapInsets:(UIEdgeInsets){
                     .left = 50, .right = 50,
                     .top = 10, .bottom = 10
                  }];
                  

                  我發現它更具可讀性,尤其是要確保我們不會混合不同的邊框/方向!

                  I find it more readable, especially to be sure we don't mix the different borders/directions!

                  這篇關于UIEdgeInsetsMake 是如何工作的?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to animate a UIImageview to display fullscreen by tapping on it?(如何通過點擊動畫 UIImageview 以顯示全屏?)
                  To stop segue and show alert(停止 segue 并顯示警報)
                  iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                  Icon already includes gloss effects(圖標已經包含光澤效果)
                  UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進度圖像(iOS 5 屬性))
                  drawRect circle and animate size/color(drawRect 圓和動畫大小/顏色)
                  <i id='yHlcZ'><tr id='yHlcZ'><dt id='yHlcZ'><q id='yHlcZ'><span id='yHlcZ'><b id='yHlcZ'><form id='yHlcZ'><ins id='yHlcZ'></ins><ul id='yHlcZ'></ul><sub id='yHlcZ'></sub></form><legend id='yHlcZ'></legend><bdo id='yHlcZ'><pre id='yHlcZ'><center id='yHlcZ'></center></pre></bdo></b><th id='yHlcZ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='yHlcZ'><tfoot id='yHlcZ'></tfoot><dl id='yHlcZ'><fieldset id='yHlcZ'></fieldset></dl></div>

                      <tbody id='yHlcZ'></tbody>
                      <bdo id='yHlcZ'></bdo><ul id='yHlcZ'></ul>
                      <tfoot id='yHlcZ'></tfoot>
                    • <legend id='yHlcZ'><style id='yHlcZ'><dir id='yHlcZ'><q id='yHlcZ'></q></dir></style></legend>
                      • <small id='yHlcZ'></small><noframes id='yHlcZ'>

                          1. 主站蜘蛛池模板: 欧美亚洲另类丝袜综合网动图 | 福利网址 | 成人在线视频网站 | 免费人成激情视频在线观看冫 | 国产精品毛片久久久久久 | 久久久高清 | 日韩成人精品一区二区三区 | 精品免费视频 | 性做久久久久久免费观看欧美 | 中文字幕一区二区三区四区五区 | 91视视频在线观看入口直接观看 | 亚洲欧美综合精品久久成人 | 狠狠久| 日韩美香港a一级毛片免费 国产综合av | 麻豆国产一区二区三区四区 | 2020国产在线| 在线成人 | 中文字幕在线一区 | 亚洲国产精久久久久久久 | 欧美精品网 | 欧美一区二区三区在线观看 | 久久综合激情 | 亚洲欧美日韩精品久久亚洲区 | 色性av | av看片| 二区在线观看 | 欧美日韩中文字幕在线播放 | 国产在线一区二区 | 91在线色视频 | 天天看夜夜 | 成人av一区二区三区 | 免费高潮视频95在线观看网站 | 超碰人人在线 | 国产精品日韩 | 亚洲国产成人久久综合一区,久久久国产99 | 欧美日韩国产综合在线 | 波霸ol一区二区 | 91天堂 | 91精品国产91久久久久久 | 免费天天干 | 欧美v日韩v |