ActionBarSherlock导致图标被拉伸 [英] ActionBarSherlock leads to icons get stretched

查看:207
本文介绍了ActionBarSherlock导致图标被拉伸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经开始整合ActionBarSherlock到我们的应用程序。一切看起来都很好,这是一个真正伟大的lib下,很容易得到英寸但是,有一个问题,我们不知道如何解决:

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:有图标的设备是绷在Android 4.2.2运行(它的Nexus 7实际上)。一切ok像HTC Desire的屏幕较小(2.3.3)上。

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:由于发生了什么事的例子:有一个大小的 48x52 像素的图标。这是在绘制文件夹中。它被用作 背景作为一个按钮组件。应用程序使用该图标,是更新,即之前,它看起来像 48x52 。现在,看着元素边框看起来好像应用程序被拉伸窗口小部件的宽度为 52x52 或更宽,保持高度一致。 layout_width,layout_height 设定为WRAP_CONTENT

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"

推荐答案

好吧,使用<一个href=\"http://stackoverflow.com/questions/12466674/android-button-image-gets-stretched-using-themes-for-actionbar-or-actionbarsherl\">this回答我设法解决 -

Ok, using this answer I managed to fix -


  1. 改变了所有的按钮在ImageButtons

  2. 所有的的android:背景 -s为的android:SRC -es

  3. 的android:背景 -s设置为透明

  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!

这篇关于ActionBarSherlock导致图标被拉伸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆