gpt4 book ai didi

java - 透明EditText Android Studio

转载 作者:行者123 更新时间:2023-12-02 09:42:35 26 4
gpt4 key购买 nike

我正在尝试使我的 android studio 项目中的 EditText 透明。我希望它看起来像这里的 EditText

但我的看起来并不像那样,即使我尝试使用 transparentffffff 有人可以帮我解决这个问题吗?我希望我的编辑文本背景看起来像我所显示的图像中的背景。

最佳答案

<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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com