界面生成器中的 Tab 键顺序?

发布于 2024-10-04 01:45:55 字数 116 浏览 0 评论 0原文

也许时间已经晚了,但我找不到在哪里可以设置界面查看器对话框的整体 Tab 键顺序,就像使用 Visual Studio 一样。

我错过了什么吗?制表符顺序全都是歪的。 Command-R 来模拟显示它。

Perhaps the hour is late, but I can't find where I can set the overall Tab Order of my interface viewer dialog, just like I can with Visual Studio.

am I missing something? The tab order is all crooked. Command-R to simulate shows it.

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

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

发布评论

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

评论(3

浅笑轻吟梦一曲 2024-10-11 01:45:55

您正在寻找的 Cocoa 术语是“关键视图循环”。使用 initialFirstRespondernextKeyView 出口按照您想要通过 Tab 键浏览视图的顺序将视图连接在一起。

此处。

请注意,可以接收键盘焦点的项目将根据“完全键盘访问”设置(在“系统偏好设置”>“键盘”中)而变化;如果禁用,选项卡将跳过关键视图循环中的各个项目。

The Cocoa term you're looking for is "key view loop". Use the initialFirstResponder and nextKeyView outlets to connect the views together in the order you'd like to tab through them.

This is mentioned in the documentation here.

Note that the items which can receive keyboard focus will change depending on the Full Keyboard Access setting (in System Preferences > Keyboard); if disabled, tabbing will skip over various items in your key view loop.

萌辣 2024-10-11 01:45:55

让出口被命名为a、b和c。 Mac 默认 Tab 键顺序是 a ->; b-> c-> a

但您想要的 Tab 键顺序是 a -> c-> b ->a :

在此处输入图像描述

使用 IB:

设置 a作为initialFirstResponder

然后将 nextKeyView 相应地放置为 a 到 c、c 到 b 和 c 到 a

但我更喜欢使用代码,在这里添加更多内容变得更容易。在复杂的 UI 中,可能有 30 多个控件,您可能需要重新排列甚至插入新控件!

所以你可以达到与以下相同的效果:

[self.a setNextKeyView:self.c];
[self.c setNextKeyView:self.b];
[self.b setNextKeyView:self.a];

Let the outlets are named as a, b and c. Mac default tab order is a -> b -> c -> a

But Your desired tab order is a -> c -> b ->a :

enter image description here

Using IB:

Set a as the initialFirstResponder.

Then put the nextKeyView accordingly as a to c, c to b and c to a.

But I prefer using codes, here it become easier to add more. As in complex UI there may be 30+ controls and you might require to shuffle and even insert new control!!!

So you can achieve the same as :

[self.a setNextKeyView:self.c];
[self.c setNextKeyView:self.b];
[self.b setNextKeyView:self.a];
你的笑 2024-10-11 01:45:55

我发现将一组文本字段放在单独的视图中将有助于控制元素获得焦点的顺序。

我在模拟器和 iPad 上进行了测试。这对我来说效果很好。

I have found that placing the group of textfields in a separate view will help control the order in which the elements get their focus.

I tested in the simulator and on an iPad. It worked well for me.

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