Được thử nghiệm với Android 1.6 (4) và 2.3.3 (10).Android EditText inputType = "none" không hoạt động, trở thành "textMultiLine"
Tôi đã thực hiện một ứng dụng thử nghiệm tối giản để chứng minh điều này, tất cả nó làm là tải xml với:
setContentView(R.layout.main);
và xml là:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
<EditText
android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="none"
android:ems="10" >
</EditText>
Vấn đề :
khi đặt inputType="none"
loại đầu vào thực tế trong khi thực thi đến textMultiLine(0x00020001)
, tôi đã kiểm tra nó bằng trình gỡ lỗi.
Mặt khác, nếu tôi sử dụng inputType="text"
, nó hoạt động như mong đợi.
Đây có phải là lỗi trong Android không?
tốt hơn để sử dụng 'setInputType (InputType.TYPE_NULL)' –