I am trying to achieve a log-in screen like the following:
Where the field's name is displayed in the field itself. I am using the ADT plugin in Eclipse. I tried setting the android:text
attribute of the text input, but I don't think this is correct because through the password field, only the dots show (the redacted text), and not the text itself. What is the attribute then. I have looked in the documentation for the EditText
widget.
The XML I currently have for the two EditText
fields are:
<EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/editText1" android:inputType="textEmailAddress" android:text="@string/username">
<requestFocus></requestFocus>
</EditText>
<EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/editText2" android:inputType="textPassword" android:text="@string/password" ></EditText>
You should be able to set default values for the fields with android:hint
or android:sethint
I think its the first.
android:hint="Please enter your password"
its the first one, thanks to a search on SO. Just for additional info it came up with this.
SO Question about android:hint
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