android - If there is no space horizontally on the screen go to the next vertically available space? -


hello android experts,

i have following layout:

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal"> <imagebutton android:id="@+id/imagebutton01" android:layout_width="80px"  android:layout_height="80px" android:background="@drawable/projects_badge" android:layout_margin="10px"/> <imagebutton android:id="@+id/imagebutton02" android:layout_width="80px"  android:layout_height="80px" android:background="@drawable/projects_badge" android:layout_margin="10px"/> <imagebutton android:id="@+id/imagebutton01" android:layout_width="80px"  android:layout_height="80px" android:background="@drawable/projects_badge" android:layout_margin="10px"/> <imagebutton android:id="@+id/imagebutton02" android:layout_width="80px"  android:layout_height="80px" android:background="@drawable/projects_badge" android:layout_margin="10px"/> <imagebutton android:id="@+id/imagebutton01" android:layout_width="80px"  android:layout_height="80px" android:background="@drawable/projects_badge" android:layout_margin="10px"/> <imagebutton android:id="@+id/imagebutton02" android:layout_width="80px"  android:layout_height="80px" android:background="@drawable/projects_badge" android:layout_margin="10px"/> </linearlayout> 

the image buttons of layout gets out of screen , become invisible. start new line.

any appreciated.

thanks in advance. :)

the pixel values of sum buttons larger pixel value of screen size, , there no view in android automatically wrap line. if want buttons go next line, need create layout view , place of buttons in there.

you may want play orientation of layout(s): http://developer.android.com/reference/android/widget/linearlayout.html#attr_android:orientation

also, side, should using dp or sp instead of px. what difference between "px", "dp", "dip" , "sp" on android?


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -