如何改变边框颜色(取消聚焦)一个EditText的? [英] How to change the border color(un-focused) of an EditText?

查看:253
本文介绍了如何改变边框颜色(取消聚焦)一个EditText的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我改变了的EditText的背景色transperant。现在的EditText看起来看不见的时候不集中。那么,如何可以改变的EditText的联合国为中心的边框颜色?

I changed the background color of the EditText to transperant. Now the EditText looks invisible when not focused. So how can I change the un-focused border color of EditText?

什么是XML属性吗?

推荐答案

在绘制(说backwithborder.xml)下面创建一个XML文件:

create a xml file with the following in drawable (say backwithborder.xml):

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="#00000000" />
    <stroke android:width="1dip" android:color="#ffffff" />
</shape>

和对用户的EditText属性的android:背景=@可绘制/ backwithborder

and for the EditText user attribute android:background="@drawable/backwithborder"

这篇关于如何改变边框颜色(取消聚焦)一个EditText的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆