官术网_书友最值得收藏!

Asset catalogs

Every project you create will contain at least a few image files in the form of launch images and application icons as well as other UI elements. Asset catalogs serve two major purposes in Xcode 5. These include automation of icon and launch image naming conventions and grouping image files together in a single location.

Asset catalogs are represented as a separate group with a blue folder in the project navigator. By default, each new project created will include the default Images.xcassets item. You may also create your own asset catalogs for further organization based on personal preference.

Xcode 5 requires each of the launch image files and icon image files to be named appropriately based on the device and/or resolution the image will be used for. When selecting the Images.xcassets item, you will see a number of empty slots waiting for images to be added. Each slot has a description of what image it holds. Dragging from your computer into Xcode 5 on the respective slot will add the image to your project and automatically configure all the naming conventions. The following screenshot shows the Asset Catalog window:

Asset catalogs

If you wish to add any additional images related to your project, you can simply drag-and-drop them into the Asset Catalog window, and Xcode 5 will take care of the rest. Both high-resolution (2x) and standard-resolution (1x) image files will be grouped together in their own image set with a common name. You still must provide both the low-resolution and high-resolution images yourself. Xcode 5 does not automatically scale them for you: it simply groups them. The value for this name can be changed to any value and will be used in code to access the associated images regardless of the actual filename.

主站蜘蛛池模板: 萍乡市| 张掖市| 廊坊市| 鄄城县| 武穴市| 竹山县| 霍邱县| 翼城县| 密云县| 吉木萨尔县| 额尔古纳市| 驻马店市| 大邑县| 临邑县| 瑞丽市| 赤峰市| 门头沟区| 南平市| 和静县| 贡觉县| 德惠市| 湘西| 平塘县| 漳州市| 邯郸县| 白沙| 曲水县| 清远市| 怀远县| 安达市| 普定县| 泰兴市| 西吉县| 新民市| 红安县| 南召县| 边坝县| 屯门区| 泾川县| 宜丰县| 霍林郭勒市|