开发者

Tab icons compatibility between API level 3 and >=5

开发者 https://www.devze.com 2023-02-07 05:51 出处:网络
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 fo

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 andr开发者_JAVA技巧oid: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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消