如何定义一个带有自定义背景的按钮并使用属性
使用此代码,属性
使用另一段代码后,可选择性正常工作,但会丢失背景颜色:
"?attr/selectableItemBackground"
?使用此代码,属性
"?attr/selectableItemBackground"
将被忽略,触摸反馈不会显示。 <Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:foreground="?attr/selectableItemBackground"/>
使用另一段代码后,可选择性正常工作,但会丢失背景颜色:
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"/>