0

I am developing app for android in Xamarin and MVVMCross. As seen below in the code, the Edittext UI-component is bound to UserInstanceId attribute.

What I am trying to do is, to force the user to enter max. 3 characters and all the character must be automatically capitalized, that's why I added the following line

   android:inputType="textMultiLine|textCapSentences"

but when the user inputs the texts, it never gets automatically capitalized.

can you please tell me why textCapSentences. does not work??

Note:i am testing on the emulator.

code

<EditText
            android:id="@+id/loginView_editText_id"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/edittext_margin_start"
            android:hint="@string/login_screen_user_id_hint"
            android:maxLength="3"
            android:inputType="textMultiLine|textCapSentences"
            app:MvxBind="Text UserInstanceId"
            style="@style/edit_text_style"/>
user10776303
  • 241
  • 6
  • 16

1 Answers1

0

you need to add android:textAllCaps="true" too in your edittext xml:

<EditText
        android:id="@+id/loginView_editText_id"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/edittext_margin_start"
        android:hint="@string/login_screen_user_id_hint"
        android:maxLength="3"
        android:textAllCaps="true"
        android:inputType="textMultiLine|textCapSentences"
        app:MvxBind="Text UserInstanceId"
        style="@style/edit_text_style"/>
Umair
  • 6,366
  • 15
  • 42
  • 50