パスワードフィールドを一連の文字で制限しようとしています。そこで、textFilterを使用してみました。inputType textFilterとtextPasswordを設定すると、パスワードドットとしての表示が停止し、Editextに入力したテキストが表示されます。textFilterを削除すると、フィールドの文字がそれ自体ではなくパスワードドットとして表示されます。
これは私のXMLリソースで使用されているスニペットです
main.xml
<EditText android:id="@+id/password" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="1"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginTop="2.0dip" android:singleLine="true"
android:scrollHorizontally="true" android:inputType="textPassword|textFilter"
android:hint="@string/input_field_here" android:digits="@string/only_alpha_numeric"></EditText>
string.xml
<string name="only_alpha_numeric">abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ/>
私に知らせてください、私の望ましい結果を達成するための可能な方法はありますか?
ありがとう