简体   繁体   English

Android 4.0设计指南和向后兼容性

[英]Android 4.0 Design Guidelines and Backwards Compatibility

Google has a great resource for Android 4.0+ Design Guidelines . Google为Android 4.0+设计指南提供了丰富的资源。 But there is still a large percentage of Android users running 2.3.x . 但是仍然有很大一部分Android 用户运行2.3.x。

What is the easiest way to use the latest design guidelines while still maintaining backwards compatibility with older OS versions? 在保持与旧版OS的向后兼容性的同时,使用最新设计指南的最简单方法是什么? There are a lot of special menus and navigation tools in the guidelines that are probably Android 4.0+ only. 准则中有很多特殊的菜单和导航工具,可能仅适用于Android 4.0+。 Do they gracefully fall back to basic elements for older versions of the OS? 它们是否会优雅地退回到旧版OS的基本元素? Do you have to create a whole separate view/template for each major Android version? 您是否需要为每个主要的Android版本创建一个单独的视图/模板?

What is the best approach to adopting the newest guidelines with leaving a large percentage of users out in the cold? 在使大部分用户处于冷漠状态时,采用最新指南的最佳方法是什么?

There is a support library from google ( link ) that ports back many of the Android 4 UI Features. Google提供了一个支持库( 链接 ),可移植许多Android 4 UI功能。 You may look at the feature list on their homepage for details. 您可以查看其主页上的功能列表以了解详细信息。

Furthermore, there is Actionbar Sherlock by Jake Wharton. 此外,还有杰克·沃顿(Jake Wharton)制作的Actionbar Sherlock。 This a is an extension to the Compatibility Actionbar that offers more features than the original from google. 这是对兼容性操作栏的扩展,它提供的功能比google的原始功能更多。 ( link ) 链接

"Do you have to create a whole separate view/template for each major Android version?" “您是否必须为每个主要的Android版本创建一个单独的视图/模板?” The answer for this is No, All you need is a single apk for all the Android versions, But the UI would be changed depending on the OS version and screen size. 答案是否定的,您需要的是所有Android版本的单个apk,但是UI会根据操作系统版本和屏幕尺寸而改变。 Android provides a number of support libraries for doing this. Android为此提供了许多支持库。 The latest design guidelines are compatible only for Android 3.X (Honeycomb) and higher. 最新的设计指南仅与Android 3.X(Honeycomb)及更高版本兼容。 For the earlier versions, the UI would behave accordingly. 对于早期版本,UI会相应地表现。 Please go through Android documentation about support libraries, and there you can find some samples too. 请浏览有关支持库的Android文档,您也可以在其中找到一些示例。

But if you want the same look for all the versions of Android, then you have to go for third party libraries like Actionbar Sherlock. 但是,如果您希望所有版本的Android都具有相同的外观,则必须使用Actionbar Sherlock之类的第三方库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM