Specifying a Resizable Area of an Image

Use the Xcode Slicing feature to specify the dimensions of a resizable center area of the image and to optionally specify end caps, which are areas of the image that should not be filled by the resizable area.

使用Xcode的Slicing功能来指定图片的可调整大小(resizable)的中心区域, 并可选择性的指定end caps,它是该图片不能被调整大小的区域。
  1. Select an asset catalog to display its contents.

    选择asset catalog显示其内容。

  2. In the set list, select the set containing the image to slice.

    在图片集列表中,选择需要切片图片所在的图片集

  3. In the set viewer, select the image representation to slice, and choose Editor > Show Slicing.

    在图片集查看区(set viewer), 选择需要切片的图片,选择Editor > Show Slicing.

  4. Click the Start Slicing button that is displayed over the center of the image.

    点击图片中央的Start Slicing按钮。

  5. Click the appropriate button for the slicing operation you want to perform—horizontal, vertical, or both horizontal and vertical.

    Use the Zoom In and Zoom Out buttons to increase or decrease the magnification of the image.

    点击你想要调整大小的方向的切片操作---水平,垂直或两者都选。使用放大和缩小按钮来增加或缩小图片的尺寸。

  6. Drag the inner slicing handle to specify a resizable center area.

    拖动内部的切片手柄(inner slicing handle)来指定一个可调整大小中心区域。

    In the horizontal slicing example shown below, the resizable area is the 2-pixel-wide sliver specified between the left slicing handle and the inner slicing handle. At runtime, the resizable area replaces the opaque area of the image.

    在下面显示的横向切片例子中,可调整大小区域是Left slicing handle 和 Inner slicing handle之间的2个像素宽的小条。 运行时,可调整大小区域将填充图片的不透明区域。

  7. Drag the outer slicing handles to adjust the size of the end caps.

    拖动外面的切片手柄(slicing handle)来调整end caps(不可调整大小区域)的尺寸。

  8. Use the Attributes inspector to fine-tune the size of the areas and to specify whether the resizable center area should stretch or tile.

    使用Attributes inspector 来微调(fine-tune)区域的尺寸,并指定可调整大小中心区域是该拉伸(stretch)或平铺(tile)。

To improve app performance, you can use resizable images for the background of many UI elements, including buttons, tab bars, and popovers. For example, you can create a resizable image that includes four end caps to define the four corners of a button. When the image is resized to fill the button’s background area, the portions defined by the end caps are drawn unchanged.

为了增强应用程序的性能,你可以给很多UI元素的背景使用可调整大小的图片,包括按钮,标签栏(tab bars)以及popovers。 比如,你可以创建一个使用可调整大小的图片的按钮,它包含四个end cap来定义按钮的四个角。 当该图片被用作按钮的背景图片时,由end caps定义的四个角绘制时不会改变。

Slicing is available only for projects with a target destination greater than iOS 7 or OS X v10.10.

切片功能只在iOS7 或 OS X v10.10版本或以上版本的项目中才能使用。

Asset Catalog Help (十)---Specifying a Resizable Area of an Image的更多相关文章

  1. Asset Catalog Help (五)---Migrating an iOS App Icon Set or Launch Image Set

    Migrating an iOS App Icon Set or Launch Image Set Simplify image management by moving existing app i ...

  2. iOS-----About Asset Catalog

    About Asset Catalogs Use asset catalogs to simplify management of images that are used by your app a ...

  3. Asset Catalog Help (二)---Creating an Asset Catalog

    Creating an Asset Catalog Create an asset catalog to simplify management of your app’s images. 创建一个a ...

  4. 【译】4个你需要知道的Asset Catalog的秘密

    本文由CocoaChina译者 @唧唧歪歪 翻译,作者:Hector Matos 原文:4 XCODE ASSET CATALOG SECRETS YOU NEED TO KNOW 恶梦 想象你正在干 ...

  5. Asset Catalog Creator Free 生成程序内图标的软件

    Asset Catalog Creator Free  生成程序内图标的软件

  6. Invalid App Store Icon. The App Store Icon in the asset catalog in 'xxx.app' can’t be transparent nor contain an alpha channel.

    1.向appstore上传应用的时候,报了这样一个错误 ERROR ITMS-90717: "Invalid App Store Icon. The App Store Icon in th ...

  7. Asset Catalog Help (十一)---Removing Images and Sets

    Removing Images and Sets Optimize the size of an asset catalog by removing unused images or sets. 通过 ...

  8. Asset Catalog Help (九)---Changing Image Set Names

    Changing Image Set Names Use the Attributes inspector to edit a set’s name. 使用属性检查器(Attributes inspe ...

  9. Asset Catalog Help (八)---Customizing Image Sets for Devices

    Customizing Image Sets for Devices Add images to a set that are customized for display on the device ...

随机推荐

  1. JavaScript 工厂模式和订阅模式

    设计模式的好处: 代码规范 // 例如表单验证,两个 input ,一个用户名,一个密码 // 通常做法是 function checkUser(){ //..... } function check ...

  2. C# trim split dataGrid

    C#中Trim().TrimStart().TrimEnd()的用法:     这三个方法用于删除字符串头尾出现的某些字符.Trim()删除字符串头部及尾部出现的空格,删除的过程为从外到内,直到碰到一 ...

  3. android中的MD5、Base64、DES/3DES/ADES加解密

    MD5摘要算法: <span style="font-size:18px;">主要代码: String s = edit.getText().toString(); i ...

  4. IOS AFNETWORKING POST

    IOS AFNETWORKING POST 请求 #pragma mark post 请求 // 获取 url 路劲,不带参数 NSString *requestUrl = [[url compone ...

  5. JavaScript读书笔记(3)-操作符、语句和函数

    1.  操作符 (1)       一元操作符 前置递增和递减操作符,变量的值都是在语句被求值以前改变的:后置相反 (2)       位操作符 在ECMAScript中,对数值进行位操作时,会发生以 ...

  6. mysql 中alter语句中change跟modify的区别

    mysql 中alter语句中change和modify的区别可以使用CHANGE old_col_name column_definition子句对列进行重命名.重命名时,需给定旧的和新的列名称和列 ...

  7. JavaScript通过正则随机生成电话号码

    没有接口,就只能自己模拟Json数据了 恰好需要模拟一些电话号码,我又懒得自己随便写, 不如写一个小功能就用来实现随机生成电话号码 <!DOCTYPE html> <html lan ...

  8. Nginx+ffmpeg的HLS开源server搭建配置及开发具体解释

    本文概述: 至眼下为止.HLS 是移动平台上很重要并十分流行的流媒体传输协议.做移动平台的流媒体开发,不知道它不掌握它 .真是一大遗憾.而HLS的平台搭建有一定的难度,本文针对对该方向有一定了解的朋友 ...

  9. 【BZOJ2338】[HNOI2011]数矩形 几何

    [BZOJ2338][HNOI2011]数矩形 题解:比较直观的做法就是枚举对角线,两个对角线能构成矩形当且仅当它们的长度和中点相同,然后用到结论:n个点构成的矩形不超过n^2.5个(不会证),所以两 ...

  10. javascript JSON.parse和eval的区别

    SON.parse()用来将标准json字符串转换成js对象:eval()除了可以将json字符串(非标准的也可以,没有JSON.parse()要求严格)转换成js对象外还能用来动态执行js代码.例如 ...