,當我嘗試添加ontouchListner
一個按鈕讓我的Android按鈕setOnTouchListener呼籲,但不會覆蓋performClick
Button has setOnTouchListener called on it but does not override performClick
警告。誰知道怎麼修它。 謝謝你..
btnleftclick.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
return false;
}
});
錯誤:
Custom view has setOnTouchListener called on it but does not override performClick 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.
請將錯誤消息文本複製並粘貼到您的問題中。 –
自定義視圖'ImageView'對其調用了setOnTouchListener,但不覆蓋performClick 如果覆蓋onTouchEvent或使用OnTouchListener的視圖並未實現performClick並在檢測到點擊時調用它,則視圖可能無法正確處理輔助功能操作。理想情況下,處理點擊操作的邏輯應放置在View#performClick中,因爲某些輔助功能服務會在發生點擊操作時調用performClick。 – kas
如果上述評論是您的錯誤消息,我建議您將其放入問題的文本中。 –