android - imageviews in TableLayout -
i have rather complex layout scrollview contains relativelayout. relativelayout contains tablelayout full of imageviews. there 40 images. of them jpegs , of them 200 pixels wide.
if layout table in 3 columns, works fine. if try layout table in 2 columns, first column displays images fine, in second columns images "truncated" , right portion of image not visible.
for kludge workaround came create "filler-image" rectangle 50 pixels wide , 100 pixels tall. stuck in 3rd column of first row of table, makes 3 row tables, , scrunches other 2 columns enough can both read. seems there should better way.
here snippet of xml (here including filler image in first row.
<tablelayout android:id="@+id/pls_table" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@id/pl_title" android:shrinkcolumns="*" android:stretchcolumns="*" > <tablerow android:layout_height="wrap_content" > <imageview android:id="@+id/pls_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustviewbounds="true" android:clickable="true" android:onclick="tsdetail2" android:scaletype="fitcenter" android:src="@drawable/abng_pl" /> <imageview android:id="@+id/pls_2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustviewbounds="true" android:clickable="true" android:onclick="tsdetail2" android:scaletype="fitcenter" android:src="@drawable/ag_supply_pl" /> <imageview android:id="@+id/pls_fill" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustviewbounds="true" android:scaletype="fitcenter" android:src="@drawable/filler_image" /> </tablerow> <tablerow android:layout_height="wrap_content" > <imageview android:id="@+id/pls_3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustviewbounds="true" android:clickable="true" android:onclick="tsdetail2" android:scaletype="fitcenter" android:src="@drawable/beard_implement_pl" /> <imageview android:id="@+id/pls_4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustviewbounds="true" android:clickable="true" android:onclick="tsdetail2" android:scaletype="fitcenter" android:src="@drawable/j_r_tire_pl" /> </tablerow>
Comments
Post a Comment