Renaud Cerrato
Renaud Cerrato

Reputation: 1347

Android EditText : shift text to left?

I'd like to use an EditText for an URL entry, along with a WebView. When the user press "enter", and so start loading the URL, I'd like to shift the EditText content to the left in order to hide the "http://" from the visible text part.

I didn't managed to use "setSelection" for that.

Any help ?

Upvotes: 1

Views: 386

Answers (1)

zrgiu
zrgiu

Reputation: 6332

There is no way of moving the content that far to the left in an EditText. You might be able to achieve that by overlapping an EditText with a transparent background over a readOnly EditText, and then set a negative left margin for the editable EditText, but you'd be better off just stripping the "http://" part of the string manually.

Upvotes: 2

Related Questions