显示文本字段无效的最 Cocoaish 方式是什么?

发布于 2024-09-13 07:31:26 字数 181 浏览 3 评论 0原文

我有一个文本字段,每当它失去焦点时都会对其进行验证。我希望能够表明该值在输入过程中无效,以便用户有机会在明确将焦点从框移开并触发验证之前纠正错误。

我见过各种实现,包括在字段周围放置红色边框、出现无效输入的小图标或一些警告文本。

以符合 Cocoa 约定和 Apple 人机界面指南的方式执行此操作的最佳方法是什么?

I have a text field which is validated whenever it loses focus. I want to be able to indicate that the value invalid during input so the user has the opportunity to correct their mistake before explicitly moving focus away from the box and triggering validation.

I have seen various implementations, including placing a red border round the field, a little icon that comes up for invalid input, or a bit of warning text.

What is the best way to do this in a way that complies with the conventions of Cocoa and the Apple Human Interface Guidelines?

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

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

发布评论

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

评论(3

左岸枫 2024-09-20 07:31:26

将其背景设置为浅红色。当您超过 Twitter 选项卡中的消息长度限制时,Adium 就会执行此操作。

Adium 使用的具体颜色是:

  • 色调:0.983
  • 饱和度:0.43
  • 亮度:0.99
  • Alpha:1.0

作为校准(通用 RGB)颜色。

Set its background to light red. This is what Adium does when you go over the message length limit in a Twitter tab.

The specific color Adium uses is:

  • Hue: 0.983
  • Saturation: 0.43
  • Brightness: 0.99
  • Alpha: 1.0

as a calibrated (Generic RGB) color.

陌若浮生 2024-09-20 07:31:26

摇动文本字段同时使其稍微变红怎么样?它在实践中可能工作得很好,也可能不好,但它用于 MobileMe 和 OS X 上用户切换的登录字段。

What about shaking the text field while making it slightly red? It may or may not work well in practice, but its used in the login field for both MobileMe and user switching on OS X.

冬天旳寂寞 2024-09-20 07:31:26

我喜欢 Windows 解决方案,并自己实现了一个小的工具提示弹出窗口。

我认为仅仅改变颜色是行不通的。通常还需要文字解释。不幸的是,MacOSX 从旧版 MacOS 中删除了气球提示。

I like the Windows solution and implemented a small tooltip popup myself.

I don't think that just changing colors doesn't will work. A textual explaination is often required too. Unfortunately MacOSX removed the balloon tips from old MacOS.

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