In my xml file, i am using bitmap as the following
android:src="@drawable/Icon"
android:gravity="center"/>
Here the image width of the icon exceeds the screen.
I tried android:width="100dp" and all. But it isn't working.
Whole xml file:
android:src="@drawable/Icon"
android:gravity="center"/>
How can i reduce the width and height of the above bitmap?
Please help,
Thanks
解决方案
Try to use ImageView instead :
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/Icon" />
UPDATE :
From Android Developers I saw that there is no tag for Bitmap XML that allow you to change it size. You need to do this via some Graphic Applications