Showing posts with label Textview. Show all posts
Showing posts with label Textview. Show all posts

Friday, 25 October 2013

Android EditText to TextView conversion (UI only)

In order to make your EditText to function like Textview(look & feel) follow the below steps. 

Step 1: 
Assign ID to your EditText object
EditText edtText = (EditText)findViewById(R.id.YourID);

Step 2: 
Disable the edtText

edtText.setEnabled(false);

Step 3:
Disable cursor

edtText.setCursorVisible(false);

Step 4: 
Set Key listner as null.

edtText.setKeyListener(null);

Step 5:
 Make background Transparent

edtText.setBackgroundColor(Color.TRANSPARENT); 

Now check your EditText