代码之家  ›  专栏  ›  技术社区  ›  alex2k8

单击非焦点编辑文本时未更新光标位置

  •  1
  • alex2k8  · 技术社区  · 16 年前

    单击非焦点编辑文本时,它将成为焦点,但光标不会移动到新位置。我应该再次单击它以将光标移动到新位置。

    1 回复  |  直到 16 年前
        1
  •  2
  •   Eric Chen    15 年前

    我花了相当长的时间来解决同样的问题,我就是这么做的:

    在布局xml中,启用focusable和focusableInTouchMode

    <LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:focusable="true" android:focusableInTouchMode="true">
    </LinearLayout>