Tôi không biết tại sao nhưng tôi không thể nhập/ghi trên EditText khi tôi cố gắng thực hiện. Con trỏ của EditText không xuất hiện và bàn phím khi xuất hiện không phải là số. Tôi có phần mã sau đây:Android: Không thể nhập vào EditText
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.android.asminhasdespesas.Meta_1Activity">
<TextView android:text="Test:"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:textColor="#000000"
android:cursorVisible="true"
android:ems="10"
android:id="@+id/editTextMeta"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:focusable="true"
android:focusableInTouchMode="true" />
<TextView
android:text="€"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
<TableRow>
<Button
android:id="@+id/buttonNaoColocar"
android:text="Cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onClick"/>
<Button
android:id="@+id/buttonOk"
android:text="Ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onClick"/>
</TableRow>
</TableLayout>
</LinearLayout>
tôi đã cố gắng để giải quyết tình trạng này với "android: cursorVisible =" true" hoặc thậm chí "android: Format =" # 000000", tôi cũng đã cố gắng "android: đặt tiêu điểm =" true" "android:.? focusableInTouchMode =" true "" nhưng vấn đề vẫn còn, tôi không thể gõ trên EditText
bạn có thể vui lòng giúp tôi
Mã bạn đưa ra phải ổn. Nó có thể được gây ra bởi một cái gì đó ở trên ... –
Bạn đang làm bất cứ điều gì với nó trong các tập tin Java của bạn? – mkorcha
Tôi nghĩ rằng kích thước văn bản chỉnh sửa quá nhỏ để nhấp vào. Nó không có nội dung văn bản và có wrap_content được đặt cho cả chiều rộng và chiều cao. Để thử nghiệm vì lợi ích, hãy thử đặt chiều rộng và chiều cao của văn bản chỉnh sửa thành 100dp và xem liệu nó vẫn không hoạt động. – CurlyCorvus