我正在努力解决一个小问题,我的问题是我在设计部分使用了透明的编辑文本视图,在4.2版本的android设备中,看起来很好,如果我检查显示在2.3版本及以下版本中的同一编辑文本,黑色的编辑文字。这是我的编辑文本代码。
<EditText android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:layout_weight="1"
android:alpha="0.3"
android:background="@drawable/reg_edittext"
android:ellipsize="end"
android:ems="10"
android:lines="1"
android:scrollHorizontally="true"
android:singleLine="true"
android:textColor="#ffffff" />
这是我的reg_edittext
<?xml version="1.0" encoding="utf-8"?>
<!-- res/drawable/rounded_edittext.xml -->
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:padding="10dp" >
<solid android:color="#000000" />
<corners android:bottomRightRadius="5dp"
android:bottomLeftRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp"/>
</shape>
在2.3版本中显示黑色的编辑文本,在4.2版本中显示透明。回答我我想在2.3版本中查看相同的透明
android:alpha="0.3" this alpha property is added in API level 14. So in the previous version it map looks different depends on devices.
尝试将backgroud纯色更改为透明,这可能会对您有所帮助。
android:color="#000000" to transparent color range- #FF000000 to #00000000
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句