1
A
回答
2
如果你想在左邊的藍線,你可以只設置上的EditText的背景,比如,
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="@drawable/custom_edittext"
android:layout_weight="1" />
然後在你的繪製文件夾中創建另一個文件這就是所謂的custom_layer.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:bottom="-5dp"
android:right="-5dp"
android:top="-5dp">
<shape android:shape="rectangle" >
<solid android:color="@color/color_of_the_background" />
<stroke
android:width="5dp"
android:color="@color/color_of_the_border" />
</shape>
</item>
</layer-list>
而最終選擇文件 - custom_edittext.xm
。
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/custom_layer">
</item>
</selector>
+0
謝謝,你幫了我很多。 –
1
U可以創建一個Shape繪製並設置形狀繪製爲的EditText背景
相關問題
- 1. Android自定義EditText
- 2. 自定義Android EditText
- 3. Android - EditText自定義樣式
- 4. android-自定義listview與edittext
- 5. Android的自定義對話框的EditText
- 6. 帶圖標的Android自定義EditText
- 7. Android:帶自定義鍵盤的EditText
- 8. Android:在EditText上的自定義AlertDialog上顯示軟鍵盤Focus
- 9. 定義自定義EditText
- 10. getsharedpreferences從自定義的edittext上下文
- 11. 如何自定義Edittext android像caculator?
- 12. Android - 里程錶輸入自定義EditText
- 13. 在EditText中自定義InputType android
- 14. 在Android中創建自定義EditText
- 15. Android:在自定義edittext中觸發softkeaboard
- 16. EditText的自定義詞典
- 17. 自定義EditText中的AsyncTask
- 18. Android - 在自定義EditText上捕獲退格(刪除)按鈕
- 19. EditText自定義背景
- 20. TextInputLayout浮動標籤自定義字體和EditText上自定義字體
- 21. 包含EditText的自定義首選項
- 22. Android中的自定義EditText:如何在XML佈局中引用?
- 23. 可滾動EditText在自定義對話框中的android
- 24. 自定義EditText上沒有顯示上述
- 25. 自定義對話框上的自定義鍵盤(Android)
- 26. 通過擴展EditText使用自定義類將android後綴設置爲EditText
- 27. 如何使用Appcompact風格在EditText上設置自定義字體顏色Android
- 28. 需要在Android中使用自定義EditText
- 29. 自定義Android EditText不能正常工作
- 30. 不能在Android中使用自定義EditText樣式
這已經存在。檢查[this](http://android-developers.blogspot.com/2015/05/android-design-support-library.html)並查找MaterialEditText。 –