Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/210.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java EditText背景色不透明度android_Java_Android - Fatal编程技术网

Java EditText背景色不透明度android

Java EditText背景色不透明度android,java,android,Java,Android,我让用户更改编辑文本视图的背景色。我还想让用户有机会设置颜色的不透明度。我的编辑文本XML代码如下所示 <EditText android:id="@+id/text_quotes" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:color/transparent" android:gravit

我让用户更改编辑文本视图的背景色。我还想让用户有机会设置颜色的不透明度。我的编辑文本XML代码如下所示

<EditText
    android:id="@+id/text_quotes"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@android:color/transparent"
    android:gravity="center"
    android:textStyle="bold"
    android:textColor="?attr/colorPrimaryDark"
    android:shadowRadius="0"
    android:text="Text" 
    android:textCursorDrawable="@null"
    android:textSize="@dimen/newMainText" />


让我知道,如果有人有想法设置不透明的改变背景颜色的这一看法。非常感谢

您可以尝试使用此alpha,它以编程方式提供不透明度

youredittext.getBackground().setAlpha(45);

您可以尝试使用此alpha,它以编程方式提供不透明度

youredittext.getBackground().setAlpha(45);

我想通过编程实现它。如果你有什么想法就告诉我。嗨!它的显示错误称为值必须大于0.0,并尝试将值设为0.4。现在视图中的setAlfa(float)无法应用于双重检查我的回答。我希望以编程方式使用它。如果你有什么想法就告诉我。嗨!它的显示错误称为值必须大于0.0,并尝试将值设为0.4。现在视图中的setAlfa(float)不能用于双重检查我的答案