android去掉Edittext的下邊線

在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"    
/>
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容