I have an EditText
like below:
<EditText
android:id="@+id/et_sum"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:background="@android:drawable/editbox_background"
android:gravity="center_horizontal"
android:inputType="numberDecimal"
android:hint="Enter sum" />
But the hint is not displayed. Is it possible to display the EditText
hint with inputType="numberDecimal"
or not?
The android:inputType attribute allows you to specify various behaviors for the input method. Most importantly, if your text field is intended for basic text input (such as for a text message), you should enable auto spelling correction with the "textAutoCorrect" value.
2- First thing we need to do is to look for icons that we can use them for the android edittext. Right click on res folder → New → Vector Asset . Adjust the size from (24dp x 24dp) to (18dp x 18dp), choose the icon that you want by clicking on the android icon, click “Next” button and then click “Finish”.
Using phone inputType EditText has an attribute called android:inputType . Providing android:inputType with value phone can display numbered keyboard when the EditText gets focus. Create an Android Project and replace layout (activity_main. xml) and Kotlin file (MainActivity.
you can use
android:ellipsize="start"
to make the hint displayed with an inputtype and gravity
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With