| Author |
How to make TextVIew behave like EditText
|
Amit Athavale
Greenhorn
Joined: Mar 31, 2003
Posts: 29
|
|
I am writing an application in which I want to make TextView editable. User should be able to tap on TextView and soft keyboard should show up and user should be able to write to TextView.
As one can see this is what we do with EditText. The deal is I want to have look and feel like a TextView and not EditView. Any idea how can I do this?
I set "Editable" attribute of TextView as true, but for sure that alone did not work.
All inputs appreciated.
Thanks!
|
 |
Monu Tripathi
Rancher
Joined: Oct 12, 2008
Posts: 1365
|
|
|
EditText is an extension(subclass) of TextView. Android is open source. You can look at the source code for EditText and see for yourself how the guys at google manage to achieve that.
|
[List of FAQs] | [Android FAQ] | [My Blog] | [Samuh Varta]
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14456
|
|
Part of the "feel" of a TextView is that it's a text VIEW and not an EDIT. So there's a bit of a conflict there.
You can use styles to customize the look of Android view items. Have you investigated that?
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
Amit Athavale
Greenhorn
Joined: Mar 31, 2003
Posts: 29
|
|
yes, I did. And I could make editText look like TextView which solves my problem.
|
 |
k joshi
Greenhorn
Joined: Dec 29, 2009
Posts: 1
|
|
Hi Amit,
I have also encountered with same issue, please share code sample to make "TextView behave like EditText".
Thanks in Advance!
|
 |
Amit Athavale
Greenhorn
Joined: Mar 31, 2003
Posts: 29
|
|
|
I made editText look like TextView by setting background color same as parent view's background color.
|
 |
 |
|
|
subject: How to make TextVIew behave like EditText
|
|
|