gpt4 book ai didi

android - 编辑文本 : How to show cursor and hide underline at a time?

转载 作者:行者123 更新时间:2023-11-29 18:58:32 25 4
gpt4 key购买 nike

我正在开发一个计算器应用程序。我想实现像 Android 默认计算器应用程序一样的 UI。请检查我的应用程序的屏幕截图。

enter image description here

我想隐藏 EditText 的下划线并以 white 颜色显示光标。我在 EditText(来自 here)中使用了透明背景,也使用了背景作为 @null。它隐藏了 EditText 的下划线,也隐藏了光标。但是...对于计算器应用程序光标不应被隐藏。

请给我一个方法来隐藏 EditText 的下划线并显示 EditText 的白色光标。

最佳答案

将背景可绘制对象设置为透明,并设置您选择的文本光标可绘制对象。例如:

<EditText
android:id="@+id/remarkEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:textCursorDrawable="@drawable/white"/>

关于android - 编辑文本 : How to show cursor and hide underline at a time?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49461990/

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