android - LinearLayout like gridview -
can put images in linearlayout 1 after 1 like
1 4 2 5 3 6
now waht happing going off screen
1 2 3
---end screen--
4
i want 4 shlould come new column
i creating image as
ts = new circularimageview(getapplicationcontext()); bitmap mybitmap = bitmapfactory.decodefile(path); ts.setimagebitmap(mybitmap); linearlayout.layoutparams layoutparams = new linearlayout.layoutparams( 150, 150); ts.setlayoutparams(layoutparams); linearlayout2.addview(ts);
to achieve linearlayout, can wrap 2 vertical linearlayouts inside horizontal linearlayout:
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" > <linearlayout android:layout_with="wrap_content" android:layout_height="fill_parent" android:orientation="vertical"> ---your images 1, 2, 3 go here --- </linearlayout> <linearlayout android:layout_with="wrap_content" android:layout_height="fill_parent" android:orientation="vertical"> ---your images 4, 5, 6 go here --- </linearlayout> </linearlayout>
still seems gridview better choice. see example: http://www.mkyong.com/android/android-gridview-example/
Comments
Post a Comment