我有一個android xml佈局,當用戶按下鍵盤上的下一個按鈕時,我想指定字段的焦點順序。android:nextFocusForward在佈局中被忽略
文檔說,那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>
我在做什麼錯在這裏?只是無法弄清楚。非常感謝!
正是這樣做了! – Sigi 2013-02-26 12:58:49