views:

42

answers:

1

My EditText configured as follows won't show the hint:

    <EditText
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="right"
    android:hint="The hint..."
    android:scrollHorizontally="true"
    android:singleLine="true" />

It works if I set android:gravity="left" or if I remove android:scrollHorizontally and android:singleLine attributes, which is not desirable. Any suggestions? Thanks!

A: 

No need of android:scrollHorizontally attribute. Remove it.EditText is a fixed item on the screen. we want scroll the layout contains the EditText is enough. that is the best design too. you have put android:ellipsize="end" instead of android:scrollHorizontally.

Praveen Chandrasekaran
Nope, that's not it. If you read documentation http://developer.android.com/reference/android/R.styleable.html#TextView_scrollHorizontally, when the text you type doesn't fit into the field, android:scrollHorizontally attribute allows the text to scroll within the field (no scroll bars of course). It has nothing to do with the layout scroll.
venuko