【问题标题】:EditText | Android TV | Softkeyboard编辑文本 |安卓电视 |软键盘
【发布时间】:2018-07-16 04:37:42
【问题描述】:

我尝试了许多不同的方法来获得键盘上的 NEXT 按钮,但没有任何效果。

以下是我关注的几个 Stackoverflow 链接。

  1. Setting EditText imeOptions to actionNext has no effect
  2. imeOptions "actionNext" programmatically - how to jump to next field?

我见过很少的 Android TV 应用程序使用下面的键盘进行输入。

知道如何获得它吗?

编辑:

这是我的 XML

<EditText
    android:id="@+id/etNric"
    android:layout_width="@dimen/three_hundred"
    android:layout_height="wrap_content"
    android:hint="@string/hint_nirc"
    android:singleLine="true"
    android:imeOptions="actionNext"
    android:maxLines="1"
    android:minLines="1"
    android:nextFocusDown="@id/etCaptcha" />

【问题讨论】:

  • 你能把你的xml贴在你实现了imeOptions的地方吗?
  • @Umair 请检查已编辑的问题
  • 检查我的回答你的主要问题是分配 id ... :)

标签: android xml android-softkeyboard android-tv


【解决方案1】:

您需要使用android:nextFocusForward,因为您也以错误的方式提供了ID。我相信真正的问题也在于这种提供身份的方式。虽然你也可以使用nextFocusDown

使用@+id/ 而不是@id/

android:imeOptions="actionNext"
android:nextFocusForward="@+id/yourNextEdittext"

您还需要指定inputType="yourInputType" 才能使编辑文本工作。

【讨论】:

  • 嗨@Umair,感谢您回答这个问题,但它不起作用。您是否在 Android TV 应用程序上尝试过这个?我认为它可能适用于 Android 应用程序
  • @AbdulAleem 我已经在 Kiosks 上实现了相同的功能,但不是在电视应用程序上,但我相信语法和工作方式将是相同的。
  • @AbdulAleem 还有一件事必须尝试使用​​它同时提供 inputType 吗?我认为它也需要它才能工作:)
  • 你想让我试试什么输入法?我试过“文本”但不工作
  • @AbdulAleem 表示它无法正常工作。您是否尝试过在代码中而不是 xml 中提供这些属性?
猜你喜欢
  • 1970-01-01
  • 2019-06-08
  • 2018-07-13
  • 1970-01-01
  • 2019-02-07
  • 2011-11-08
  • 1970-01-01
  • 2011-10-29
相关资源
最近更新 更多