我有一个 android xml 布局,当用户按下键盘上的下一步时,我想指定字段的焦点顺序。
文档说,android:nextFocusForward=TARGET_ID应该做到这一点。但它在我们所有的测试设备上都被忽略了。一些运行 2.3 的旧设备和运行 4.1 的新 Nexus 设备。
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<EditText
android:textCursorDrawable="@null"
android:id="@+id/firstname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:layout_marginTop="6dp"
android:layout_weight="1"
android:singleLine="true"
android:background="#00000000"
android:textColor="#000"
android:nextFocusForward="@+id/lastname"
android:padding="2dp"/>
<EditText
android:textCursorDrawable="@null"
android:id="@+id/lastname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:layout_marginTop="6dp"
android:layout_weight="1"
android:background="#00000000"
android:singleLine="true"
android:textColor="#000"
android:padding="2dp"/>
</LinearLayout>
我在这里做错了什么???就是想不通。非常感谢!