xml佈局設置:
<EditText
android:id="@+id/etInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:cursorVisible="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:layout_marginLeft="10dp"
android:layout_toLeftOf="@+id/tvMore"
android:layout_toRightOf="@+id/tvTitle"
android:digits="@string/digits_cedit_card"
android:inputType="text"
tools:text="title" />
代碼動態設置:
editText.setCursorVisible(false);
editText.setFocusable(false);
editText.setFocusableInTouchMode(false);