在xml文件中設(shè)置以下這個(gè)屬性即可:
android:background="@null"
style="?android:attr/textViewStyle"
如:
<EditText
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@null"
style="?android:attr/textViewStyle"
/>
更新填坑,經(jīng)過(guò)上述設(shè)置之后我發(fā)現(xiàn)的確沒(méi)有邊框了,但是有一個(gè)問(wèn)題,就是我的光標(biāo)也不見(jiàn)了,我猜是因?yàn)閷邮皆O(shè)置成textview的后果,然后我就把style那句刪了,發(fā)現(xiàn)既有光標(biāo)又沒(méi)有邊框,開(kāi)心
以下是更新后的代碼
<EditText
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@null"
/>