问题
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