• Post Reply Bookmark Topic Watch Topic
  • New Topic

Non Editable Text Field

 
Muhammad Imad Qureshi
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I make my text field non editable but use it to display results from my calculations? I want a look similar to EditText and that's why I don't want to use TextView.

Thanks
Imad
 
Ksh Aggarwal
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Muhammad Imad Qureshi wrote:How can I make my text field non editable but use it to display results from my calculations? I want a look similar to EditText and that's why I don't want to use TextView.


I suppose you can set the editable property to true or false in the layout xml file
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
focusable & focusableInTouchMode attributes might be of some help Or
I think, you can put a background(use the same 9-patch drawable used for the EditText) on the TextView to make it look similar to EditText.
 
Muhammad Imad Qureshi
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying. Setting focusable to false in my layout.xml file worked. Setting editable might also work but its deprecated. Thanks to both of you for replying.
 
I love a good mentalist. And so does this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!