Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActionBarSherlock Item Icon strange width with Android 4.3

I`m developing an App using ActionBarSherlock

One of the items in the menu is a rectangular image. See it`s xml:

<item
    android:id="@+id/kapturar_action"
    android:showAsAction="always"
    android:icon="@drawable/camera_action_icon"
    android:title="@string/kapturar" />
<item

So far so good. The problem is that the SDK 4.3 appears to accept only square images (This is my supposition, i`m not sure of that) and the icon shows in a strange fashion preserving what appears to be a "max width" property.

See the printscreens

Android 2.2 - Simulator:

Android 2.2

Android 4.1.2 - Samsung Galaxy S3 Mini:

Android 4.1.2

Android 4.3 - Nexus 4:

Android 4.3

I double checked the drawables and I think that everything is right. I have defined the MDPI, HDPI and XHDPI images.

Can anybody affirm that is impossible to use rectangular drawables in the menu`s item? Is there a way to fix the problem in the Android 4.3 preserving the backward-compatible?

like image 490
Renato Lochetti Avatar asked Nov 12 '13 15:11

Renato Lochetti


1 Answers

Action Bar Sherlock is now deprecated as Google released their own Action Bar compatibility library.

I strongly recommend to switch to that official library, I guess/hope your problem won't appear there.

like image 129
galex Avatar answered Sep 30 '22 12:09

galex