【发布时间】:2012-02-26 04:43:47
【问题描述】:
我在更改按钮背景图像时遇到问题。 所以我有2张图片(png-24透明背景)。 图像是一个简单的圆圈和同一个圆圈,但有一些外发光)。 我有以下代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ticketing_row_topup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@layout/pressed_topup_button"
android:orientation="horizontal" >
<TextView
android:id="@+id/topup_name"
android:layout_width="60dp"
android:layout_height="fill_parent"
android:gravity="center_vertical|right"
android:paddingRight="5dip"
android:paddingTop="22dip"
android:text="€"
android:textColor="@color/black"
android:textSize="35sp"
android:textStyle="bold" />
<TextView
android:id="@+id/topup_display_amount"
android:layout_width="90dp"
android:layout_height="match_parent"
android:gravity="center_vertical|left"
android:textSize="65sp"
android:textColor="#0d457f"
android:textStyle="bold" />
</LinearLayout>
还有pressed_topup_button.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:state_enabled="false">
<item android:state_pressed="true" android:state_enabled="true" android:drawable="@drawable/button_topup_glow" />
<item android:state_focused="true" android:state_enabled="true" android:drawable="@drawable/button_topup" />
<item android:state_enabled="true" android:drawable="@drawable/button_topup" />
</selector>
LinearLayout 用于在每个单元格中填充一个 GridView。 当我单击单元格时,行为是正确的(显示辉光),但图像的角落也显示黄色(假设是透明的)。我该如何解决? 谢谢
【问题讨论】:
-
你也可以添加截图吗?
标签: android background android-linearlayout transparent