Что я могу понять из Вашего вопроса
1) Там будут 3 вид кнопки, TextView и EditText под одним LinearLayout
Как это:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click Button" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="My TextView " />
<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="phone" // with input type phone
android:visibility="gone" />
</LinearLayout>
И Вы хотите удалите текст и замените его кнопкой «Редактировать текст» на кнопке « »
tv=(TextView)findViewById(R.id.textView1);
et=(EditText)findViewById(R.id.editText1);
Button b=(Button)findViewById(R.id.button1);
b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
tv.setVisibility(View.GONE);
et.setVisibility(View.VISIBLE);
}
});
LinearLayout имеет метод s, чтобы очистить все элементы от него, после чего вы сможете добавлять новые представления программно. –
что я понимаю из вашего вопроса, просто играйте с «редактируемым» свойством EditText, и вы получите то, что хотите. перейдите по этой ссылке: http://stackoverflow.com/questions/660151/how-to-replicate-androideditable-false-in-code Примечание: нет необходимости в другом текстовом режиме, один текст редактирования здесь отлично работает. – Manish