Designing for Multiple Screens//为多样的屏幕设计
Android powers hundreds of device types with several different screen sizes, ranging from small phones to large TV sets. Therefore, it’s important that you design your application to be compatible with all screen sizes so it’s available to as many users as possible.
//从小手机到大的电视,Android为有不同屏幕的上百种设备提供动力。因此,那是非常重要的,设计你的应用兼容所有尺寸的屏幕,以让尽可能多的用户获得。
But being compatible with different device types is not enough. Each screen size offers different possibilities and challenges for user interaction, so in order to truly satisfy and impress your users, your application must go beyond merely supportingmultiple screens: it must optimize the user experience for each screen configuration.
//但是兼容不同的设备是不够的。每一种尺寸都为用户的交互提供了不同的可能性和挑战,所有为了给你的用户以真正的令人满意的印象,你的应用必须超过仅仅是支持多样的屏幕:它必须为每一种尺寸的配置使用户的体验最优。
This class shows you how to implement a user interface that's optimized for several screen configurations.
//这个类将向你展示如何实现一个接口去优化不同的屏幕配置。
The code in each lesson comes from a sample application that demonstrates best practices in optimizing for multiple screens. You can download the sample (to the right) and use it as a source of reusable code for your own application.
//下面每一课的代码来自于一个示例应用,它展示了在优化多样的屏幕方面的一个最佳的联系。你可以下载这个例子(在右边)并且把它作为一个可重用的代码的源在你的应用里面。Fragment
APIs on versions lower than Android 3.0. You must download and add the library to your application in order to use all APIs in this class.
RelativeLayout
, screen size and orientation
qualifiers, alias
filters, and nine-patch bitmaps).//支持不同尺寸的屏幕