Creating a unified look and feel throughout a user interface adds value to your product. Streamlining the graphic style will also make the UI seem more professional to users.
创造统一的视觉并且有一致的界面体验能够使你的产品更加有价值。Streamlining图片风格也将使UI看起来更专业的呈现给用户。
This document provides information to help you create icons for various parts of your application’s user interface that match the general styles used by the Android 2.x framework. Following these guidelines will help you to create a polished and unified experience for the user.
这篇文章提供的信息,帮助你创建多种多样的程序界面ICON,从而符合android 2.X架构的一致风格。跟随这些指南,将帮助你创建完成的和统一的体验给用户。
To get started creating your icons more quickly, you can download the Android Icon Templates Pack. For more information, see Using the Android Icon Template Pack.
要快速获得ICON,你可以下载Android Icon 模板包。更多信息可参见Using the Android Icon Template Pack.
Providing Density-Specific Icon Sets
提供特定分辨率的的ICON集合
Android is designed to run on a variety of devices that offer a range of screen sizes and resolutions. When you design the icons for your application, it's important keep in mind that your application may be installed on any of those devices. As described in the Supporting Multiple Screens document, the Android platform makes it straightforward for you to provide icons in such a way that they will be displayed properly on any device, regardless of the device's screen size or resolution.
Android被设计成能运行在一系列屏幕尺寸和分辨率的设备上。当你为android应用程序设计ICON时,保证程序能够运行在任何设备上,这一点非常重要。就像Supporting Multiple Screens文章描述的,android平台能够非常简单,使ICON显示在不同的设备上, 不管设备的屏幕尺寸和分辨率
In general, the recommended approach is to create a separate set of icons for each of the three generalized screen densities listed in Table 1, below, then store them in density-specific resource directories in your application. When your application runs, the Android platform will check the characteristics of the device screen and load icons from the appropriate density-specific resources. For more information about how to store density-specific resources in your application, see Resource directory qualifiers for screen size and density.
总体上讲,推荐的方法是为三类屏幕密度中的每一种屏幕提供不同的图标集。保存图标在不同的程序的density-specific 资源文件夹中。
当程序运行时,android平台会检查设备的屏幕规格参数,然后从适合的资源目录中加载icon。
The baseline screen density for Android devices is medium (mdpi
). For this reason, a recommended approach to creating icon sets for multiple screen densities is to:
屏幕密度基准是MDPI,
- Design the icons for the baseline density first (see Table 1 for the actual pixel dimensions at which to design the icons).
- Place the icons in the application's default drawable resources, then run the application on an Android Virtual Device (AVD) or an HVGA device such as the T-Mobile G1.
- Test and adjust your baseline icons as needed.
- When you are satisfied with the icons you've developed at the baseline density, create scaled copies for the other densities.
- Scale the baseline icons up 150% to create the high-density assets.
- Scale the baseline icons down 75% to create the low-density assets.
- Place the icons in density-specific resource directories in your application. For example:
- Medium-density assets go in a
res/drawable-mdpi/
directory (or in the defaultres/drawable/
directory), - High-density assets go in a
res/drawable-hdpi/
directory, and - Low-density assets go in a
res/drawable-ldpi/
directory.
- Medium-density assets go in a
- Test and adjust the high- and low-density icons if needed
For tips on how to create and manage icon sets for multiple densities, see Tips for Designers.
Table 1. Summary of finished icon dimensions for each of the three generalized screen densities, by icon type.
Icon Type | Standard Asset Sizes (in Pixels), for Generalized Screen Densities | ||
---|---|---|---|
Low density screen (ldpi) | Medium density screen (mdpi) | High density screen (hdpi) | |
Launcher | 36 x 36 px | 48 x 48 px | 72 x 72 px |
Menu | 36 x 36 px | 48 x 48 px | 72 x 72 px |
Status Bar | 24 x 24 px | 32 x 32 px | 48 x 48 px |
Tab | 24 x 24 px | 32 x 32 px | 48 x 48 px |
Dialog | 24 x 24 px | 32 x 32 px | 48 x 48 px |
List View | 24 x 24 px | 32 x 32 px | 48 x 48 px |
Launcher Icon
启动图标
A Launcher icon is a graphic that represents your application on the device’s Home screen and in the Launcher window.
The user opens the Launcher by touching the icon at the bottom of the Home screen. The Launcher opens and exposes the icons for all of the installed applications, which are arranged in a grid. The user selects an application and opens it by touching the Launcher icon or by means of any hardware navigation controls available, such as a trackball or d-pad.
The user can also drag an icon out of the Launcher window and onto the Home screen itself, for more convenient access to the application. In this case, the system displays your application's Launcher icon against the Home screen wallpaper, rendering it at the same dimensions as it is rendered inside the Launcher.
The system manages the scaling of all Launcher icons so that they rendered at a uniform height and width. The actual pixel dimensions of the rendered Launcher icons on any given device varies, based on the size and pixel-density characteristics of the device's screen. To ensure the best possible rendering for your icons, supply versions of the icons that are designed for low, medium, and high density screens. For information, see Providing Density-Specific Icon Sets, above, or Tips for Designers, below.