版权声明:本文为博主原创文章,转载请注明出处http://blog.csdn.net/u013132758。 https://blog.csdn.net/u013132758/article/details/49205467
editText控件,边框其实是背景决定的,所以如果你的editText没有边框,可以通过以下两种方式解决:
1、给editText设置一个带边框的背景,可以是shape绘制一个corner和solid,也可以是用一个切好的.
2、你应该是用的主题不对,把application的主题改成android:Theme.Light.NoTitleBar,editText的样式应该是有边框的那种了。
下面是一个实例
把下面的代码保存到res/drawable/et.xml,在layout中的EditText添加属性android:background="@drawable/et"
et.xml↓代码
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="#EFEFEF"/>
<corners
android:bottomRightRadius="5dip"
android:bottomLeftRadius="5dip"
android:topLeftRadius="5dip"
android:topRightRadius="5dip"/>
<stroke
android:width="0.5px"
android:color="#505050"/>
</shape>
</item>
</layer-list>