在xml文件中設置以下這個屬性即可:
android:background="@null"
style="?android:attr/textViewStyle"
如:
<EditText
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@null"
style="?android:attr/textViewStyle"
/>
更新填坑,經過上述設置之后我發現的確沒有邊框了,但是有一個問題,就是我的光標也不見了,我猜是因為將樣式設置成textview的后果,然后我就把style那句刪了,發現既有光標又沒有邊框,開心
以下是更新后的代碼
<EditText
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@null"
/>