在它自己的ImageButton背景swiching?可绘狂野? [英] ImageButton background swiching on it's own? Drawables gone wild?

查看:152
本文介绍了在它自己的ImageButton背景swiching?可绘狂野?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有那里的ImageButton的背景被绘制不同的绘制从我的资源之一的问题。我设置的背景是透明的,但在某些情况下,它拿起我的所谓的可绘制的bottom_shadow.9.png之一。为什么为什么!?它吓坏奇怪...

I having an issue where the ImageButton background is being drawn with a different drawable from one of my resources. I'm setting the background to be transparent but on some cases it's picking up one of my drawables called bottom_shadow.9.png. Why why!? It's freaking weird...

我已经看到了这个问题之前......我的一些应用程序的用户抱怨遇到这个问题,现在我决心要算出这个!下面就拿我现在有一个看看。任何提示或想法会有所帮助。

I've seen this issue before... Some of my app users have complained seeing this issue and now I'm determined to figure this out! Take a look below what I currently have. Any tips or ideas would help.

我在值/ colors.xml创建的颜​​色值:

The color value I created under values/colors.xml:

<color name="transparent">#00000000</color>

我在布局下我的一XML布局的ImageButton /:

My ImageButton under my one xml layout under layout/:

<ImageButton
    android:id="@+id/ibHelp"
    android:layout_width="wrap_content"
    android:layout_height="@dimen/settings_list_item_height"
    android:background="@color/transparent"
    android:contentDescription="@string/content_desc_more_information"
    android:paddingLeft="10dp"
    android:paddingRight="10dp"
    android:scaleType="centerInside"
    android:src="@drawable/btn_help" />

这是我所看到的生成R.java文件:

This is what I'm seeing on the generated R.java file:

public static final class drawable {
  public static final int bottom_shadow=0x7f020000;
}

public static final class color {
  public static final int transparent=0x7f080009;
}

这是它应该是什么样子:

This is what it should look like:

这是我所看到的:

推荐答案

难道与此有关的问题?

HTTP://$c$c.google。 COM / p /安卓/问题/细节?ID = 20283个

这篇关于在它自己的ImageButton背景swiching?可绘狂野?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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