Tôi có EditText (người dùng có thể nhập số in), vì vậy khi người dùng nhấp vào hộp văn bản Chỉnh sửa bàn phím có số được mở.Android: Bàn phím trùng lặp với EditText (với màn hình in)
như bạn sẽ nhìn thấy bàn phím ẩn một phần nhỏ trong hộp văn bản.
Nhưng khi tôi nhấn một phím, ví dụ: 0, có vẻ ổn.
Có điều gì tôi có thể làm (ngoài việc đặt EditText cao hơn) để nó trông giống như trong hình thứ hai?
Edit: mã .xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:weightSum="1">
<RelativeLayout android:id="@+id/relativeLayout1" android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:layout_width="wrap_content" android:orientation="vertical" android:layout_height="wrap_content" android:id="@+id/linearLayout1" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_alignParentRight="true">
<android.widget.CheckedTextView android:id="@+id/checkedTextView1" android:layout_height="wrap_content" android:layout_width="fill_parent" android:textSize="17sp" android:text="@string/toString"></android.widget.CheckedTextView>
<AutoCompleteTextView android:layout_height="wrap_content" android:id="@+id/autoCompleteTextView1" android:layout_width="fill_parent" android:text="@string/emptyString" android:textSize="17sp" android:gravity="top|left" android:minHeight="62dp">
<requestFocus></requestFocus>
</AutoCompleteTextView>
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/linearLayout2">
<Button android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="0.33333333333" android:text="@string/contactsString" android:textSize="17sp" android:id="@+id/contactsButton"></Button>
<Button android:layout_weight="0.33333333333" android:layout_height="wrap_content" android:text="@string/groupsString" android:layout_width="fill_parent" android:id="@+id/groupsButton" android:textSize="17sp"></Button>
<Button android:layout_weight="0.33333333333" android:layout_height="wrap_content" android:text="@string/favouritesString" android:layout_width="fill_parent" android:id="@+id/button3" android:textSize="17sp"></Button>
</LinearLayout>
<TextView android:id="@+id/textView1" android:text="@string/messageString" android:layout_height="wrap_content" android:textSize="17sp" android:layout_width="fill_parent"></TextView>
<EditText android:layout_height="wrap_content" android:id="@+id/editText1" android:layout_width="fill_parent" android:gravity="top|left" android:minHeight="105dp"></EditText>
<TextView android:id="@+id/textView2" android:text="@string/repetition" android:layout_height="wrap_content" android:layout_width="fill_parent" android:textSize="17sp"></TextView>
<Spinner android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/spinner"></Spinner>
<LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout3" android:layout_width="fill_parent">
<ImageView android:src="@drawable/button_time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageView1" android:layout_weight="0.1"></ImageView>
<EditText android:layout_height="wrap_content" android:id="@+id/timeET" android:inputType="number" android:layout_width="wrap_content" android:layout_weight="0.4"></EditText>
<ImageView android:src="@drawable/button_date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageView2" android:layout_weight="0.1"></ImageView>
<EditText android:layout_height="wrap_content" android:id="@+id/dateET" android:inputType="number" android:layout_width="wrap_content" android:layout_weight="0.4" android:layout_marginRight="3dp"></EditText>
</LinearLayout>
<RelativeLayout android:id="@+id/relativeLayout2" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_alignParentLeft="true">
<Button android:layout_weight="0.5" android:layout_height="wrap_content" android:text="@string/button_ok" android:layout_width="fill_parent" android:id="@+id/button4" android:textSize="17sp"></Button>
<Button android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/button5" android:layout_weight="0.5" android:text="@string/button_cancel" android:textSize="17sp"></Button>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
Tôi sẽ cố gắng sau này vào ngày hôm nay hoặc sáng ngày mai và tôi sẽ cho bạn biết cách hoạt động của nó. cảm ơn! – Belgi
p.s: ý của bạn là viết date.requestLayout(); tại date.setOnTouchListener? – Belgi
@Frankenstein hehe cảm ơn bạn rất nhiều vì đã bình luận. Tôi muốn xóa câu trả lời của tôi ngay bây giờ nhưng bình luận của bạn đã ngăn cản tôi! Dù sao tôi trả lời khoảng tôi nghĩ rằng một ScrollView gốc sẽ giải quyết vấn đề. Có vẻ tôi đã nhầm. Tại sao chúng ta cần LinearLayout gốc trong câu trả lời của bạn? Tôi thực sự không có nhiều chi tiết về câu hỏi này nhưng tôi nghĩ rằng người nghe OnFocus là lựa chọn đúng đắn. Dù sao tôi không thể bình luận về chi tiết tôi có cuối tuần của tôi để thưởng thức. Cám ơn bạn một lần nữa !! +1 –