我正在尝试使我的 android studio 项目中的 EditText
透明。我希望它看起来像这里的 EditText
但我的看起来并不像那样,即使我尝试使用 transparent
和 ffffff
有人可以帮我解决这个问题吗?我希望我的编辑文本背景看起来像我所显示的图像中的背景。
最佳答案
<EditText
android:layout_width="match_parent"
android:layout_margin="32dp"
android:layout_height="wrap_content"
android:hint="Username"
android:padding="16dp"
android:background="@drawable/edittext_bg" />
drawables 文件夹中的 edittext_bg.xml:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#80ffffff" />
<corners android:radius="5dp" />
</shape>
更改 <solid android:color="#80ffffff" />
的颜色值调整透明度。
关于java - 透明EditText Android Studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56941056/