ImageButtonの背景が、自分のリソースの1つとは異なるドローアブルで描画されているという問題があります。背景を透明に設定していますが、場合によっては、bottom_shadow.9.pngという名前のドローアブルの1つを取得しています。なぜ!?変だなぁ…
私は以前にこの問題を見たことがあります...私のアプリユーザーの何人かはこの問題を見て不平を言っていました、そして今私はこれを理解することを決心しています!私が現在持っているものの下を見てください。ヒントやアイデアがあれば役立ちます。
values /colors.xmlの下に作成した色の値:
<color name="transparent">#00000000</color>
layout/の下の1つのxmlレイアウトの下にあるMyImageButton:
<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ファイルに表示されているものです。
public static final class drawable {
public static final int bottom_shadow=0x7f020000;
}
public static final class color {
public static final int transparent=0x7f080009;
}
これはどのように見えるべきかです:
これは私が見ているものです: