EditText:如何一次显示光标和隐藏下划线? [英] EditText: How to show cursor and hide underline at a time?

查看:133
本文介绍了EditText:如何一次显示光标和隐藏下划线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发计算器应用程序.我想要实现UI,就像Android默认的Calculator App一样.请检查我的应用程序的屏幕截图.

I'm developing an Calculator App. I wanna achieve the UI as like as Android default Calculator App. Please check my App's screenshot.

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

I want to hide the underline of EditText and show the cursor in white color. I used transparent background at EditText (from here) also used background as @null. It hides EditText's underline and also hide the cursor. BUT... for calculator App cursor should not be hidden.

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

Please give me a way to hide underline of EditText and show the EditText's cursor of white color.

推荐答案

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

Set the background drawable as transparent and set the Text Cursor drawable of your choice. For Example:

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

这篇关于EditText:如何一次显示光标和隐藏下划线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆