Andrea
Andrea

Reputation: 4503

EditText hint not showing (Java - android)

I saw lots of questions about this topic, but I've found anything that solve my problem. I saw different solutions:

But no one has worked. Here's a sample of my code:

<EditText
    android:id="@+id/edtNotesText"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_below="@+id/layoutNotesEditMenu"
    android:gravity="left|top"
    android:hint="@string/edt_text_notes_add_hint"
    android:inputType="textFilter|textMultiLine|textNoSuggestions"
    android:padding="6dp"
    android:scrollbars="vertical"
    android:textColor="@color/lightGrey"
    android:textSize="20sp" />

Upvotes: 1

Views: 1300

Answers (3)

Azurespot
Azurespot

Reputation: 3152

None of those that you mentioned worked for me either, until I looked into my .java class file code. I had this:

   poemTitle.setText(poemListItem.getTitle());
   poemText.setText(poemListItem.getPoem());

As soon as I commented those out, then my hint text showed in both of my EditTexts. I had this code there to draw upon a model class to get text, but actually don't need it since my app's users will edit their own text.

Upvotes: 0

Andrea
Andrea

Reputation: 4503

I've find out the problem: I forgot the instruction "setContentView"! Might be trivial but maybe could help someone else.

Upvotes: 0

karan
karan

Reputation: 8853

try changing your edit text's color and set proper gravity

android:textColorHint="#FFFFFF"
android:gravity="center"
android:ellipsize="end"

this is worth a try...

Upvotes: 4

Related Questions