根据点击位置设置对应事件 @Override public boolean onTouch(View v, MotionEvent event) { //以rightDrawable为例 if (event.getAction() == MotionEvent.ACTION_UP) { if (event.getRawX() = mTitleText.getRight() - mTitleText.getTotalP
@Override public boolean onTouch(View v, MotionEvent event) { //以rightDrawable为例 if (event.getAction() == MotionEvent.ACTION_UP) { if (event.getRawX() >= mTitleText.getRight() - mTitleText.getTotalPaddingRight()) { onDrawableClick(); return true; } else { performClick(); } } return true; }