-2

Having a strange issue, Image given below having size of 136x166

enter image description here

when I set this in ImageView/Button with wrap_content then this image became large

<Button
  android:id="@+id/btn_reports"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:background="@drawable/report_image" />

Output: with wrap_content

enter image description here

<Button
      android:id="@+id/btn_reports"
      android:layout_width="136px"
      android:layout_height="166px"
      android:background="@drawable/report_image" />

Output: with fixed sized imagesize(original 136x166)

enter image description here

Why so, anybody faced this issue?

Mohammed Azharuddin Shaikh
  • 41,633
  • 14
  • 96
  • 115

1 Answers1

0

It is because I created icon for hdpi and putting icon in drawable folder rather than drawable-hdpi

I got the solution by my own while doing research Application support multiple screen and you can find the answer here

Community
  • 1
  • 1
Mohammed Azharuddin Shaikh
  • 41,633
  • 14
  • 96
  • 115