ActionBarSherlock leads to icons get stretched

ε祈祈猫儿з 提交于 2020-01-07 06:07:14

问题


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 -

  1. changed all the Buttons to ImageButtons
  2. all the android:background-s to android:src-es
  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!