I have a big image that will be used eventually as an icon for an Action bar. So, I would like to reduce its size before that.
How can I do that via XML?
styles.xml:
<style name="AppTheme" parent="android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/actionBarStyle</item>
</style>
<style name="actionBarStyle" parent="android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">@drawable/shape_gradient_action_bar</item>
<item name="android:displayOptions">showHome</item>
<item name="android:icon">@drawable/icon</item>
</style>
icon.xml:
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ford_dtect_logo_on_white"
android:width="50dp" -- Doesn't work
android:height="50dp" > -- Doesn't work
</bitmap>
Thanks in advance.
You cannot. You will have to create the image the size you want it.
As you can see in the documentation, there are no
widthorheightattributes of any kind.One possibility may be to use
android:gravity="fill", but I make no guarantees about this working.