5
Tôi có một Hoạt động đăng nhập đơn giản có hai chỉnh sửa văn bản fileds, tên người dùng và mật khẩu .. Bây giờ tôi muốn đạt được sau hai tính năng,Xử lý Xong và tiếp theo của SoftKeypad trong Android?
- Nếu nút bên cạnh được chạm trong khi tập trung vào userNameText, các con trỏ nên di chuyển đến lĩnh vực EditText thứ hai tức là passwordText ..
- Nếu làm được nhấn trong khi con trỏ là trên sân passwordText, tôi muốn gọi một hàm được gọi là bên trong OK Trình nghe của Nút.
tập tin XML của tôi trông như thế này
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/online" >
<TextView
android:id="@+id/userNamelbl"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/userNameLbl" />
<EditText
android:id="@+id/userNametxt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/userNamelbl"
android:background="@android:drawable/editbox_background"
android:hint="@string/userNameTxt"
android:maxLines="1"
android:nextFocusDown="@+id/passwordtxt"
android:singleLine="true" />
<TextView
android:id="@+id/passwordlbl"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/userNametxt"
android:text="@string/passwordLbl" />
<EditText
android:id="@+id/passwordtxt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/passwordlbl"
android:background="@android:drawable/editbox_background"
android:hint="@string/passwordTxt"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true" />
<Button
android:id="@+id/okBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@id/passwordtxt"
android:layout_marginLeft="10dip"
android:text="@string/okLbl" />
<Button
android:id="@+id/cancelBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/okBtn"
android:layout_toLeftOf="@id/okBtn"
android:text="@string/cancelLbl" />
</RelativeLayout>
Tôi chưa thực hiện thêm bất kỳ điều gì về các thay đổi của nút văn bản và thay đổi tiếp theo của chúng tôi tập trung tự động. – user1378730
Đã kiểm tra lại ... nhưng tiếc là không hoạt động, tiếp theo là không làm gì ... bạn có thể dán mã XML của mình làm câu trả lời cho câu hỏi này để tôi có thể so sánh ... – aProgrammer