gpt4 book ai didi

java - recyclerView 小部件中的下一个焦点方向

转载 作者:行者123 更新时间:2023-11-30 00:19:17 25 4
gpt4 key购买 nike

当创建仅包含两个 editText 小部件的简单 recyclerView 时,键入数据时下一个焦点元素的方向与 pic1 上的一样 --- 如何设置下一个焦点元素的方向,如 pic2 上的那样?干杯

pic1

pic2

我的简单代码

 <LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/edit_text_left"
tools:hint="editTextLeft"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" />

<EditText
android:id="@+id/edit_text_right"
tools:hint="editTextRight"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" />

</LinearLayout>

最佳答案

尝试使用 android:imeOptions="actionNext" 将焦点移动到下一个 Edittext

<EditText
android:id="@+id/edit_text_left"
tools:hint="editTextLeft"
android:layout_width="0dp"
android:layout_weight="1"
android:inputType="text"
android:imeOptions="actionNext"
android:layout_height="wrap_content" />

这样布局

<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/edit_text_left"
tools:hint="editTextLeft"
android:layout_width="0dp"
android:layout_weight="1"
android:inputType="text"
android:imeOptions="actionNext"
android:layout_height="wrap_content" />

<EditText
android:id="@+id/edit_text_right"
tools:hint="editTextRight"
android:layout_width="0dp"
android:layout_weight="1"
android:inputType="text"
android:imeOptions="actionNext"
android:layout_height="wrap_content" />

</LinearLayout>

关于java - recyclerView 小部件中的下一个焦点方向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46603072/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com