Change mouse cursor image in application?

陌路散爱 提交于 2019-12-12 02:41:25

问题


I able to connected mouse with my device and it's working perfectly, but I want to change cursor image for specific to app. How we can do it. Any idea/suggestion?


回答1:


I don't think it is possible on a per-app basis. The pointer icon images are part of the framework and their style attributes are internal.

From core/res/res/values/styles.xml:

<!-- Pointer styles -->
<style name="Pointer">
    <item name="android:pointerIconArrow">@android:drawable/pointer_arrow_icon</item>
    <item name="android:pointerIconSpotHover">@android:drawable/pointer_spot_hover_icon</item>
    <item name="android:pointerIconSpotTouch">@android:drawable/pointer_spot_touch_icon</item>
    <item name="android:pointerIconSpotAnchor">@android:drawable/pointer_spot_anchor_icon</item>
</style>

And from core/res/res/values/themes.xml:

<!-- Pointer style -->
<item name="pointerStyle">@android:style/Pointer</item>

Since they are internal, you won't be able to override them in your own styles.



来源:https://stackoverflow.com/questions/19558849/change-mouse-cursor-image-in-application

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!