2011-07-15 7 views
4

私はログイン画面次のように達成しようとしています:フィールドの名前がフィールド自体に表示されenter image description hereAndroidのテキスト入力 - フィールドに示されているフィールド名自体

。私はEclipseでADTプラグインを使用しています。私はテキスト入力のandroid:text属性を設定しようとしましたが、これは正しいとは思いません。なぜなら、パスワードフィールドを通して、ドットだけが表示され(テキスト化されたテキスト)、テキスト自体ではないからです。それでは属性は何ですか?私はthe documentation for the EditText widgetを見ました。

私は現在、2つのEditTextフィールドを持っているXMLは、次のとおりです。

<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> 
+0

あなたが持っているXMLを投稿してもよろしいですか? – sealz

+0

@ harper89、私は質問を編集しました。他に何かがある場合は教えてください。 – Gus

答えて

8

あなたは私が最初だと思うandroid:hintまたはandroid:sethintのフィールドのデフォルト値を設定することができるはずです。

android:hint="Please enter your password" 

その最初の1つは、SOの検索のおかげです。追加情報のために、それはこれを思い付いた。

SO Question about android:hint

関連する問題