Alternative resource facility built into Android supports conditions based on API level (= Android version):

http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources

From this starting point, one can derive different solutions:

- Switch at layout level, providing entirely separate layouts for 1.5 and 1.6+

- Move just the view that needs to be handled differently into version-specific layout files with <merge> as top level element, and pull them into the main layout using <include>

http://developer.android.com/resources/articles/layout-tricks-merge.html

- Switch at the drawable level, by creating version-specific aliases for the background drawable.

http://developer.android.com/guide/topics/resources/providing-resources.html#AliasResources

However, I suspect there is something wrong with the nine-patch that is causing 1.5 to blow up. Perhaps trying some other nine-patch (perhaps even a button background from sdk resources) would be a good test before trying the above.

-- Kostya

14.09.2010 21:45, Frank Weiss пишет:

I suppose you could add OS-specific info to the layout XML files and write your own layout inflater.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to