android editText实现没有边框,没有背景的效果

来源:互联网 发布:warframeUDP端口4950 编辑:程序博客网 时间:2024/05/09 07:22

在实际开发中,会遇到一个布局包含一个edittext,然后这个edittext需要设置成没有边框,没有背景的效果,下面直接上代码


<span style="white-space:pre"></span><EditText                                android:layout_width="fill_parent"                                android:layout_height="wrap_content"                                android:textCursorDrawable="@null"                                android:background="@null" />

最后两个参数就是设置成没有边框没有背景的输入框了. 并且在这里还有一个需要注意的地方那就是,当我们把它的背景设置成null的时候这个edittext也就没有边框了已经,

android:textCursorDrawable="@null"这个是设置我们点击输入的光标的颜色,如果像我们现在这么设置的话光标的颜色就和我们输入框中字体的颜色是一样的了,以上就是要保存的了



0 0