不可编辑编辑字段突出显示问题

发布于 2025-01-04 23:37:12 字数 532 浏览 2 评论 0原文

我的屏幕上有一个不可编辑的编辑字段。为了区分可编辑字段和不可编辑字段,我已将不可编辑字段的背景设置为浅灰色,如下代码所示:

  Border nonEditableBorder=BorderFactory.createRoundedBorder(new XYEdges(5, 5, 5, 5),Color.LIGHTGRAY,Border.STYLE_FILLED|Border.STYLE_TRANSPARENT);
  EditField textField=new EditField(EditField.NO_NEWLINE|EditField.FOCUSABLE|DrawStyle.RIGHT);
  textField.setBorder(nonEditableBorder);

现在,在不可编辑字段上,当我向右或向左滚动轨迹球时,文本会显示以白色突出显示,如下图所示: 在此处输入图像描述

我不希望文本突出显示。有人可以帮我解决这个问题吗?提前致谢。

I have a non editable edit field in my screen. In order to differentiate between editable and non editable field i have set the background of the non-editable field to light gray as in the code below:

  Border nonEditableBorder=BorderFactory.createRoundedBorder(new XYEdges(5, 5, 5, 5),Color.LIGHTGRAY,Border.STYLE_FILLED|Border.STYLE_TRANSPARENT);
  EditField textField=new EditField(EditField.NO_NEWLINE|EditField.FOCUSABLE|DrawStyle.RIGHT);
  textField.setBorder(nonEditableBorder);

Now on the non-editable field when i scroll the trackball to the right or left the text gets highlighted in white as shown in the image below:
enter image description here

I do not want the text to get highlighted. Can someone please help me with this. Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

晨曦÷微暖 2025-01-11 23:37:12

除了设置边框之外,我还将背景设置为与边框相同的颜色,这解决了我的问题。

In addition to setting the border i also set the background to the same color as the border and that solved my problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文