pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <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="i3nmmcd" 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="j8tidpg" id='GA4gh'><tfoot id='GA4gh'></tfoot><dl id='GA4gh'><fieldset id='GA4gh'></fieldset></dl></div>
                  本文介紹了UIEdgeInsetsMake 是如何工作的?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  我正在制作一個(gè)應(yīng)用程序,我將 UIEdgeInsetsMake 用于 resizableImageWithCapInsets,但我不明白它是如何工作的,UIEdgeInsetsMake有 4 個(gè)參數(shù):

                  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:

                  • 頂部
                  • 底部
                  • 對(duì)

                  但它們是浮動(dòng)的,所以我不知道如何將其設(shè)置為圖像,謝謝!:D

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

                  推薦答案

                  根據(jù)文檔:

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

                  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.

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

                  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 函數(shù)的值中使用您想要使其不可拉伸的像素?cái)?shù)量.

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

                  假設(shè)您有一張 21x50 點(diǎn)的圖像(標(biāo)準(zhǔn)清晰度為 21x50 像素,Retina @2x"清晰度為 42x100 像素)并希望此圖像可水平拉伸,保持左右 10 個(gè)點(diǎn)不變拉伸圖像時(shí),但僅拉伸中間 1 點(diǎn)寬的帶.然后你將使用 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).

                  不要擔(dān)心它們是浮點(diǎn)數(shù)(例如,這對(duì)于亞像素調(diào)整大小很有用,但實(shí)際上您可能只會(huì)使用整數(shù)(或沒(méi)有小數(shù)部分的浮點(diǎn)數(shù))

                  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+ 獨(dú)有的方法,iOS5 之前不可用.如果您使用 iOS5 之前的 SDK,請(qǐng)改用 stretchableImageWithLeftCapWidth:topCapHeight:.

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

                  一些提示我使用了一段時(shí)間,因?yàn)槲也挥浀?UIEdgeInsets 結(jié)構(gòu)的字段的順序是什么 - 以及我們應(yīng)該以什么順序?qū)?shù)傳遞給 UIEdgeInsetsMake 函數(shù) — 我更喜歡使用 指定初始化"語(yǔ)法如下:

                  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 };
                  

                  或者當(dāng)需要顯式轉(zhuǎn)換時(shí):

                  Or when an explicit cast is needed:

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

                  我發(fā)現(xiàn)它更具可讀性,尤其是要確保我們不會(huì)混合不同的邊框/方向!

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

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

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

                  相關(guān)文檔推薦

                  How to animate a UIImageview to display fullscreen by tapping on it?(如何通過(guò)點(diǎn)擊動(dòng)畫 UIImageview 以顯示全屏?)
                  To stop segue and show alert(停止 segue 并顯示警報(bào))
                  iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                  Icon already includes gloss effects(圖標(biāo)已經(jīng)包含光澤效果)
                  UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進(jìn)度圖像(iOS 5 屬性))
                  drawRect circle and animate size/color(drawRect 圓和動(dòng)畫大小/顏色)
                  <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="m8wgmd8" 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. 主站蜘蛛池模板: 联系我们老街华纳娱乐公司官网19989979996(客服) | 背压阀|减压器|不锈钢减压器|减压阀|卫生级背压阀|单向阀|背压阀厂家-上海沃原自控阀门有限公司 本安接线盒-本安电路用接线盒-本安分线盒-矿用电话接线盒-JHH生产厂家-宁波龙亿电子科技有限公司 | 无线联网门锁|校园联网门锁|学校智能门锁|公租房智能门锁|保障房管理系统-KEENZY中科易安 | 农业四情_农业气象站_田间小型气象站_智慧农业气象站-山东风途物联网 | 拉力机-拉力试验机-万能试验机-电子拉力机-拉伸试验机-剥离强度试验机-苏州皖仪实验仪器有限公司 | 美国PARKER齿轮泵,美国PARKER柱塞泵,美国PARKER叶片泵,美国PARKER电磁阀,美国PARKER比例阀-上海维特锐实业发展有限公司二部 | 体感VRAR全息沉浸式3D投影多媒体展厅展会游戏互动-万展互动 | 电采暖锅炉_超低温空气源热泵_空气源热水器-鑫鲁禹电锅炉空气能热泵厂家 | 山东臭氧发生器,臭氧发生器厂家-山东瑞华环保设备 | 咖啡加盟-咖啡店加盟-咖啡西餐厅加盟-塞纳左岸咖啡西餐厅官网 | 空心明胶胶囊|植物胶囊|清真胶囊|浙江绿键胶囊有限公司欢迎您! | 玻璃钢罐_玻璃钢储罐_盐酸罐厂家-河北华盛节能设备有限公司 | 量子管通环-自清洗过滤器-全自动反冲洗过滤器-北京罗伦过滤技术集团有限公司 | 组织研磨机-高通量组织研磨仪-实验室多样品组织研磨机-东方天净 传递窗_超净|洁净工作台_高效过滤器-传递窗厂家广州梓净公司 | 江苏密集柜_电动_手动_移动_盛隆柜业江苏档案密集柜厂家 | 产业规划_产业园区规划-产业投资选址及规划招商托管一体化服务商-中机院产业园区规划网 | 真空吸污车_高压清洗车厂家-程力专用汽车股份有限公司官网 | 真空上料机(一种真空输送机)-百科 | 大_小鼠elisa试剂盒-植物_人Elisa试剂盒-PCR荧光定量试剂盒-上海一研生物科技有限公司 | 捆扎机_气动捆扎机_钢带捆扎机-沈阳海鹞气动钢带捆扎机公司 | 济南铝方通-济南铝方通价格-济南方通厂家-山东鲁方通建材有限公司 | 冻干机(冷冻干燥机)_小型|实验型|食品真空冷冻干燥机-松源 | 金属抛光机-磁悬浮抛光机-磁力研磨机-磁力清洗机 - 苏州冠古科技 | 涡轮流量计_LWGY智能气体液体电池供电计量表-金湖凯铭仪表有限公司 | 板框压滤机-隔膜压滤机-厢式压滤机生产厂家-禹州市君工机械设备有限公司 | 合肥废气治理设备_安徽除尘设备_工业废气处理设备厂家-盈凯环保 合肥防火门窗/隔断_合肥防火卷帘门厂家_安徽耐火窗_良万消防设备有限公司 | app开发|app开发公司|小程序开发|物联网开发||北京网站制作|--前潮网络 | NMRV减速机|铝合金减速机|蜗轮蜗杆减速机|NMRV减速机厂家-东莞市台机减速机有限公司 | 高压绝缘垫-红色配电房绝缘垫-绿色高压绝缘地毯-上海苏海电气 | 中国产业发展研究网 - 提供行业研究报告 可行性研究报告 投资咨询 市场调研服务 | 微信小程序定制,广州app公众号商城网站开发公司-广东锋火 | 电脑知识|软件|系统|数据库|服务器|编程开发|网络运营|知识问答|技术教程文章 - 好吧啦网 | 标策网-专注公司商业知识服务、助力企业发展 | 河南道路标志牌_交通路标牌_交通标志牌厂家-郑州路畅交通 | 泰来华顿液氮罐,美国MVE液氮罐,自增压液氮罐,定制液氮生物容器,进口杜瓦瓶-上海京灿精密机械有限公司 | 西安中国国际旅行社(西安国旅) | 电镀电源整流器_高频电解电源_单脉双脉冲电源 - 东阳市旭东电子科技 | 太原装修公司_山西整装家装设计_太原室内装潢软装_肖邦家居 | 换链神器官网-友情链接交换、购买交易于一体的站长平台 | 成都热收缩包装机_袖口式膜包机_高速塑封机价格_全自动封切机器_大型套膜机厂家 | (中山|佛山|江门)环氧地坪漆,停车场地板漆,车库地板漆,聚氨酯地板漆-中山永旺地坪漆厂家 |