
我试过这个:
rounded_textfIEld.xml:
<shape xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:shape="rectangle" androID:padding="10dp"> <solID androID:color="#EEEEEE"/> <corners androID:bottomrighTradius="8dp" androID:bottomLefTradius="8dp" androID:topLefTradius="8dp" androID:topRighTradius="8dp"/></shape>activity.xml:
<EditText androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:ID="@+ID/searchFIEld" androID:layout_row="0" androID:layout_column="0" androID:drawableleft="@drawable/search" androID:background="@drawable/rounded_edittext" androID:minHeight="50dp"/>在编辑器中它是灰色的,但在手机上它是白色的.
解决方法:
你的代码是对的,只需清理项目.有一点你应该记住,根据不同的设备显示设置和显示屏幕,不同颜色的颜色会有所不同.
总结以上是内存溢出为你收集整理的如何改变editText背景色(Android)?全部内容,希望文章能够帮你解决如何改变editText背景色(Android)?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)