问题
We have started integrating ActionBarSherlock into our app. Everything looks great, it's a really great lib, that gets in easily. But, there's one issue we don't know how to solve:
Some of the icons on some pages for larger screens get stretched. Has anybody had such problem?
Upd. 1.: Device that has icons stretched is running on Android 4.2.2 (it's Nexus 7 actually). All ok on a smaller screen like HTC Desire (2.3.3).
Upd. 2.: As the example of what is happening: there's an icon of a size of 48x52 pixels. It is in the "drawable" folder. It is used as the background for a Button widget. Before the update the app used this icon as is, i.e., it looked like 48x52. Now, looking at the element borders it looks as if the app is stretching the widget's width to be 52x52 or even wider, keeping the height same. layout_width, layout_height are set to "wrap_content"
回答1:
Ok, using this answer I managed to fix -
- changed all the Buttons to ImageButtons
- all the android:background-s to android:src-es
- android:background-s set to 'transparent'
But! I don't know why it happened and why it worked! Any clues? Thank you!
来源:https://stackoverflow.com/questions/17124343/actionbarsherlock-leads-to-icons-get-stretched