【发布时间】:2017-11-14 09:15:20
【问题描述】:
如何在横向软键盘中获取光标位置。在纵向模式下我可以使用 OnTouchListener,但在横向模式下,OnTouchListener 在全屏软键盘上不起作用。
editText.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
cursorPosition = editText.getOffsetForPosition(motionEvent.getX(), motionEvent.getY()); // will give you the position of the nearest chracter.
return false;
}
});
简而言之,我该如何在横向全屏键盘上执行上述操作..
【问题讨论】:
标签: android android-softkeyboard ontouchlistener