为Android按钮控制启用默认触摸效果

为Android按钮控制启用默认触摸效果,android,button,touch,Android,Button,Touch,在第一个原生android应用程序上,我创建了如下按钮 <Button android:id="@+id/yesPhone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@color/colorApprove" android:te

在第一个原生android应用程序上,我创建了如下按钮

<Button
            android:id="@+id/yesPhone"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@color/colorApprove"
            android:text="Confirm"
            android:textColor="#ffffff"
            android:textSize="18dp"
            android:layout_weight="1"/>


当我在Android设备上运行并点击按钮时,没有触摸/点击效果向用户显示按钮处于活动状态。我需要添加一些指令来实现这一点吗?

是的,只需将其替换为您自己的
android:background=“?android:attr/selectableItemBackground”
按钮