不可编辑编辑字段突出显示问题
我的屏幕上有一个不可编辑的编辑字段。为了区分可编辑字段和不可编辑字段,我已将不可编辑字段的背景设置为浅灰色,如下代码所示:
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:
I do not want the text to get highlighted. Can someone please help me with this. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
除了设置边框之外,我还将背景设置为与边框相同的颜色,这解决了我的问题。
In addition to setting the border i also set the background to the same color as the border and that solved my problem.