我要添加圖像按鈕,自定義的漣漪效應的圖像按鈕設置連鎖反應。但是如果我改變背景,它會在圖像後面顯示顏色效果。此外,我設置了表格行和圖像按鈕包裝內容,但仍找不到解決方案。 請幫我設置漣漪效果只在圖像按鈕不在外面的空間。如何只對項目的TableRow Android的
<TableRow
android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:gravity="center_horizontal"
android:layout_gravity="center_horizontal"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
>
<ImageButton
android:id="@+id/ess_btn_leave"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.5"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@drawable/leave"
android:background="?android:attr/selectableItemBackground"
/>
<ImageButton
android:id="@+id/ess_imgbtn_expence"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.5"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:background="@null"
android:src="@drawable/expence"
/>
</TableRow>
是什麼tagetversion? –
tergetversion- 25 –
你應該有'width'或'height' = 「0dp」 按方向由於使用layout_weight'的'。 –