0

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?

A23149577
  • 2,045
  • 2
  • 40
  • 74
  • Try to give your ImageButtons constant width and height, at the same time using android:scaleType – Arshak92 Oct 22 '14 at 09:31
  • @Arshak92 I am using scaleType. As you see in my xml I am using this attribute with padding to cover 75% of my button, but as I said in small screen icons are too small – A23149577 Oct 22 '14 at 09:38

0 Answers0