• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

How to make TextVIew behave like EditText  RSS feed

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 19664
92
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Amit Athavale
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, I did. And I could make editText look like TextView which solves my problem.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made editText look like TextView by setting background color same as parent view's background color.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!