How do I limit the size of an ImageButton within a LinearLayout ?
I limited the size of LinearLayout and left the image sizes as wrap_content
thinking it would fit the layout size but the image was cropped. When I do not limit the size of the layout the image gets a lot bigger than I would 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>