I followed every approaches but nothing works for me.
Here is the case, I have five ImageButtons
which are in row and each has a icon and background drawable:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="0.33"
android:orientation="horizontal"
android:weightSum="5" >
<ImageButton
android:id="@+id/food"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:padding="20dp"
android:scaleType="fitCenter"
android:layout_marginRight="2dp"
android:layout_marginBottom="2dp"
android:layout_marginLeft="2dp"
android:layout_marginTop="2dp"
android:background="@drawable/chooser_effect"
android:src="@drawable/restaurant_icon" />
this is one of my imageButtons, others are the same.
When I test this layout on my active device which is Samsung S5, it works great. Since I want my icons fit about 75% of button padding and scaleType are accurate but, when I run my app on emulator which has small screen size, icons are too small, and by "too small" I mean they can not be seen at all. I tried every other solutions which I found like using android:scaleYpe="fitXY"
but then my icons are too big and their resolution quality get deprecated. Any clue?