Java EditText背景色不透明度android
我让用户更改编辑文本视图的背景色。我还想让用户有机会设置颜色的不透明度。我的编辑文本XML代码如下所示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
<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)不能用于双重检查我的答案