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的设计
- 9. 带图标的Android自定义EditText
- 10. Android:在EditText上的自定义AlertDialog上显示软键盘Focus
- 11. 定义自定义EditText
- 12. getsharedpreferences从自定义的edittext上下文
- 13. Android - 里程表输入自定义EditText
- 14. 在Android中创建自定义EditText
- 15. 如何自定义Edittext android像caculator?
- 16. Android:在自定义edittext中触发softkeaboard
- 17. 在EditText中自定义InputType android
- 18. Android自定义EditText视图和NextFocusDown
- 19. Android - 自定义EditText前缀颜色
- 20. EditText的自定义词典
- 21. 自定义EditText的ActionMenu
- 22. 自定义EditText中的AsyncTask
- 23. 在EditText上自定义错误文本边框android
- 24. Android - 在自定义EditText上捕获退格(删除)按钮
- 25. 定制我的Android EditText上
- 26. 如何自定义EditText?
- 27. EditText自定义背景
- 28. 自定义EditText验证
- 29. 多个自定义EditText
- 30. 自动显示EditText的自定义键盘。 Android
这已经存在。检查[this](http://android-developers.blogspot.com/2015/05/android-design-support-library.html)并查找MaterialEditText。 –