【Android】ImageButton state_pressed 无效

Android – “Press and hold” button on Android needs to change states (custom XML selector) using onTouchListener

主要是为了实现长按语音功能使用了setOnTouchListener事件,覆盖了默认操作;
可在motionevent.action_down/action_pointer_down下添加view.setPressed(true);
motionevent.action_up/action_pointer_up下添加view.setPressed(false);
来处理。
xml



    
    

你可能感兴趣的:(android)