0
How do I limit the size of a Imagebutton within a Linearlayout?
I limited the size of Linearlayout and left the image sizes as wrap_content
thinking it would fit the size of the layout but the image was cropped. When I don’t limit the size of layout the picture is much bigger than I’d like it to be.
Code:
<LinearLayout
android:layout_width="50dp"
android:layout_height="70dp"
android:orientation="vertical"
android:layout_alignParentEnd="true">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/addproduto"
android:background="@null"
android:src="@drawable/setacima" />
<TextView
android:layout_width="25dp"
android:layout_height="20dp"
android:text="0"
android:textAlignment="center"
android:textColor="@color/primary_text"
android:id="@+id/textView" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:id="@+id/tiraproduto"
android:src="@drawable/setabaixo"/>
</LinearLayout>
worked out, thank you very much!
– Éowyn