gpt4 book ai didi

android - 如何删除彩色 EditText 焦点边框

转载 作者:行者123 更新时间:2023-11-30 01:17:51 25 4
gpt4 key购买 nike

我想删除 EditText 底部的 EditText 焦点边框。我想要它让我的 EditText 看起来像这样:

enter image description here

话虽如此,我已经在网上查看了它,以便删除 EditText 的底部焦点颜色试图将我的 EditText 设置为 android: background="#00000000"android:background="@android:drawable/editbox_background_normal"。然而,hte 首先隐藏了整个下划线边框(我只想隐藏焦点下划线颜色,而不是下划线本身),后者使我的 EditText 成为一个大白框。有什么办法可以复制我上面想要的东西吗?谢谢!

最佳答案

试试这个

edittext_bg.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<!-- Draw a 1dp width border around shape -->
<stroke
android:color="#d3d3d3"
android:width="1dp"
/>
</shape>
</item>
<!-- Draw only bottom border using background color -->
<item
android:bottom="1dp"
>
<shape android:shape="rectangle">
<solid android:color="#ffffff"/>
</shape>
</item>
</layer-list>

并将背景应用到您的 EditText

android:background="@drawable/edittext_bg"

关于android - 如何删除彩色 EditText 焦点边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37582503/

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