Android: layout with imageView re-sizing buttons wrongly -


i have layout problem, want image in middle of 2 buttons. created 2 buttons , defined weightsum of 1. set weight of 2 buttons .40 , image .20 image small logo in middle of 2 buttons. problem image stretched out , buttons pushed aside.

<button     android:id="@+id/buttonclear"     style="@style/buttontext"     android:layout_width="wrap_content"     android:layout_height="fill_parent"     android:layout_weight=".40"     android:background="@drawable/custombuttonred"     android:text="@string/clear"     android:textsize="50sp" />  <imageview     android:id="@+id/myimage"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_weight=".20"     android:src="@drawable/imageid" />  <button     android:id="@+id/buttonbackspace"     style="@style/buttontext"     android:layout_width="wrap_content"     android:layout_height="fill_parent"     android:layout_weight=".40"     android:background="@drawable/custombuttonred"     android:text="@string/backspace"     android:textsize="20sp" /> 

i had faced same issue. used button insted of imageview , set background image it.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -