0

what's the best layout to use to display a series of image button, side by side (as displayed in attached image), and that will fills the screen horizontally when the orientation changes to horizontal (as attached)?

horizontal orientation http://img254.imageshack.us/img254/657/layoutxs.png vertical orientation http://img208.imageshack.us/img208/2428/layouthy.png

imin
  • 4,504
  • 13
  • 56
  • 103

3 Answers3

1

It looks like you want to use something like FlowLayout, which doesn't exist in Android. You can make your own, however. More information

I have an activity with a layout similar to yours, but I use a different method. What I do is define a different xml layout for landscape and portrait. So I have layout-port/mylayout.xml and layout-land/mylayout.xml and the system determines which one the activity should use.

Community
  • 1
  • 1
skynet
  • 9,898
  • 5
  • 43
  • 52
1
<GridView android:layout_width="fill_parent"
     android:layout_height="wrap_content" 
         android:numColumns="auto_fit" >
</GridView> 
Shailendra Singh Rajawat
  • 8,172
  • 3
  • 35
  • 40
0

just create two separate layout files and call setContentView() in your onOrientationChanged().