界面生成器中的 Tab 键顺序?
也许时间已经晚了,但我找不到在哪里可以设置界面查看器对话框的整体 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您正在寻找的 Cocoa 术语是“关键视图循环”。使用
initialFirstResponder
和nextKeyView
出口按照您想要通过 Tab 键浏览视图的顺序将视图连接在一起。此处。
请注意,可以接收键盘焦点的项目将根据“完全键盘访问”设置(在“系统偏好设置”>“键盘”中)而变化;如果禁用,选项卡将跳过关键视图循环中的各个项目。
The Cocoa term you're looking for is "key view loop". Use the
initialFirstResponder
andnextKeyView
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.
让出口被命名为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 多个控件,您可能需要重新排列甚至插入新控件!
所以你可以达到与以下相同的效果:
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
:Using IB:
Set
a
as theinitialFirstResponder
.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 :
我发现将一组文本字段放在单独的视图中将有助于控制元素获得焦点的顺序。
我在模拟器和 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.