Tab icons compatibility between API level 3 and >=5

本小妞迷上赌 提交于 2019-12-12 06:39:31

问题


My application uses tabs and it is built on top of SDK Level 3 (Android 1.5).

Google mentions that tab icons "changed drastically" in Android 2.0, so they recommend making two sets of icons, one for < level 5 and another for >= level 5, and set the android:targetSdkVersion to 5 in the application manifest (see http://developer.android.com/guide/practices/ui_guidelines/icon_design_tab.html). BUT this attribute was introduced in API Level 4, so there is no way to declare it because I'm on API Level 3 (see http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#target).

What's the proper way to handle this case?


回答1:


After developing the code at level 3 (to guarantee that you aren't using APIs that were introduced later), change the target level to 5 or higher and patch up the manifest. Code compiled for more recent targets will run on level 3 devices as long as the code only uses level 3 API calls. You can also add resource folders with "-v5" in the name to put the level >= 5 icons.



来源:https://stackoverflow.com/questions/4801443/tab-icons-compatibility-between-api-level-3-and-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!