我想改變TextView
到EditText
和TextView
到EditText
,所以我決定用ViewSwitcher
元素在Android上,我就android developer website讀到它。變化的EditText TextView的到
但是我仍然有一些點,我不明白:
- 我怎麼能確定目前的開關? (例如,只顯示
EditText
,以及無形TextView
)
這裏是我的代碼:
<ViewSwitcher
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/my_switcher"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:id="@+id/clickable_text_view"
android:clickable="true"
android:onClick="TextViewClicked"
android:text="@string/some_value" />
<EditText
android:id="@+id/hidden_edit_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/some_value" >
</EditText>
</ViewSwitcher>
非常感謝!它真的幫助我 – 2013-04-09 13:52:24