gpt4 book ai didi

android - 解释 ClickableViewAccessibility

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:36:39 32 4
gpt4 key购买 nike

关于the SO swipe code , Android lint 给出了警告

OnSwipeTouchListener#onTouch should call View#performClick when a click is detected [ClickableViewAccessibility]

description of the warning ,它说:

If a View that overrides onTouchEvent or uses an OnTouchListener does not also implement performClick and call it when clicks are detected, the View may not handle accessibility actions properly. Logic handling the click actions should ideally be placed in View#performClick as some accessibility services invoke performClick when a click action should occur.

您如何“正确处理辅助功能操作”?

最佳答案

出现警告是因为代码监听了 onTouchEvent(参见 docs, point 3)。有一个指向 solution for a click event 的指针,但这并没有解决是否需要处理滑动。

解决方法是使用触发与滑动事件相同的 Action 的按钮。然后,使用 @SuppressWarnings

关于android - 解释 ClickableViewAccessibility,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31344451/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com