views:

39

answers:

1

Is this possible to interchange a TextView and an EditText. Like display the text when needed, but allow editing when needed. Is there a method (as in NON-XML) way of editing a TextView or non-editing a EditText?

+2  A: 

Is this possible to interchange a TextView and an EditText.

Put both in your layout in the same spot. Make one invisible. Toggle visibility as needed.

Or, put both as children of a ViewSwitcher or ViewFlipper, and use that to switch between them.

Is there a method (as in NON-XML) way of editing a TextView or non-editing a EditText?

No, AFAIK.

CommonsWare
What difference between ViewSwitcher and ViewFlipper?
Mohit Deshpande
@Mohit Deshpande: "A ViewSwitcher can only have two child views, of which only one is shown at a time." (http://developer.android.com/reference/android/widget/ViewSwitcher.html) `ViewFlipper` supports more than two and has extra features, such as animated transitions between them. I have only used `ViewFlipper`.
CommonsWare