问题描述
我创建了一个ImageButton,当我对其进行长按时,其背景变为黑色。如何将其样式从
此外,在长按时如何在按钮上添加
解决方法
您可以使用:
<androidx.appcompat.widget.AppCompatImageButton
android:background="?attr/selectableItemBackgroundBorderless"
../>
和:
val imageButton : ImageButton = findViewById(R.id.imagebutton)
ViewCompat.setTooltipText(imageButton,"Tooltip")