android - 指针图标可以像其他视图一样在 RecyclerView 上设置吗?
问题描述
我已经在我使用过的所有按钮和约束布局上设置了指针图标,但我不知道如何在 recyclerview 项目上设置指针图标。如何在 recyclerview 项目上实现鼠标指针图标?
我试图在膨胀视图上实现指针图标,但它没有用。
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="28dp"
android:layout_height="28dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:layout_marginStart="3dp"
android:layout_marginEnd="3dp"
android:pointerIcon="hand"
>
<ImageView
android:id="@+id/img_icon_social_apps"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:pointerIcon="hand"
/>
</android.support.constraint.ConstraintLayout>
我希望当鼠标悬停在 recyclerview 内的项目上时指针图标会改变。
解决方案
推荐阅读
- qt - 2 个不同 QML 文件中的 2 个不同对象之间的通信
- javascript - php Ajax文件上传,总是出现未定义索引错误
- c++ - 正则表达式搜索不接受参数
- python - 正则表达式匹配变量字符后的字符串
- ruby-on-rails - 如何将密码箱 gem 与 ransack gem 一起使用?
- delphi - 将 SmallInt 常量定义为十六进制
- android - 当媒体记录器开始录制视频时,Camera.PreviewCallback 的“onPreviewFrame”方法停止工作
- java - 如何在应用程序中包含大型字符串数组资源?
- php - 我刚刚在我的 macbook 中激活了 php,但它说的是权限错误
- javascript - 如果未包装,则JQuery将字符串的每个单词包装在span中