Reputation: 13
With the latest versions of android, mobile has been added as a lower bar of the tablets. That has made my application in these particular versions, may not appear properly, as it is designed to be seen without the bar.
So my question is: is there any way to make a layout version exclusive to these versions?
Upvotes: 0
Views: 61
Reputation: 14472
You can inflate any layout you like and set it as the Activity content.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
this.setContentView(R.layout.layout_pre_ics);
} else {
this.setContentView(R.layout.layout_post_froyo);
}
[EDIT] Android developer's solution is better than mine.
Upvotes: 0
Reputation: 116412
either do it programmatically like what "Simon" has written , or use the correct resource folder (using qualifiers) , for example:
res/layout-v11/ will be used for honeycomb and above .
res/layout/ will be for the rest.
for more info read here:
http://developer.android.com/guide/topics/resources/providing-resources.html
Upvotes: 2