【发布时间】:2015-07-05 17:18:24
【问题描述】:
在我的应用程序中,我将EditText 设置为边框背景颜色,它在所有设备上都可以正常工作,但是在我的4.1.2 设备上,整个EditText 显示为黑色。我可以在其中输入文本,一切正常,但文本不可见,因为EditText 是完全黑色的。如果我删除背景边框颜色,它工作正常。
这是我编辑文本的 xml 代码。
<EditText
android:id="@+id/et_date_from"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.68"
android:background="@drawable/edittext_border"
android:ems="10" />
edittext_border.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:thickness="0dp" >
<stroke
android:width="1dp"
android:color="@color/test_blue_light" />
<corners android:radius="5dp" />
</shape>
请给我任何解决方案。
【问题讨论】:
-
您是否尝试过明确地为该形状赋予类似白色的颜色?到目前为止,您只是设置了笔触颜色。
标签: android android-layout colors android-edittext border