cocoa-touch - 如何在 iOS 工具栏中显示标准的向上/向下控件

标签 cocoa-touch ios interface-builder

我想知道 Apple 是否为工具栏的向上/向下箭头键提供标准控件?所有其他熟悉的按钮都出现在 Interface Builder 中,但不是箭头键。

arrow controls

有没有办法以编程方式显示它们?

最佳答案

没有公共(public)内置控件来显示这样的按钮。不过,您可以轻松地创建自己的 UISegmentedControl 并将 momentary 设置为 YES(使用 [[UIBarButtonItem alloc] initWithCustomView:...] 将其放在工具栏中,当然)。

您可以使用 Unicode 字符 U+25B2 表示 ▲ 和 U+25BC 表示 ▼,或者您可以使用适当的图像。

关于cocoa-touch - 如何在 iOS 工具栏中显示标准的向上/向下控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5300814/

相关文章:

iphone - 第一个和最后一个 UITableViewCell 在滚动时不断变化

iphone - 如何获得小数点符号?

ios - 在 iphone xcode 中存储经纬度的最佳和最精确的数据类型是什么?

ios - iPad上的UIDocumentInteractionController PopOver

ios - 如何利用约束 - FluentConstraints 和 FluentLayouts for Xamarin.iOS

ios - 为钢琴风格的 UI 元素添加辅助功能

ios - 如何在iPad上的搜索栏中跟踪 "Hide keyboard"按钮?

iphone - 如何在 Interface Builder 的 UILabel 中输入 unicode 字符?

ios - UILabel 双线和约束

xcode - Interface Builder - 文档在哪里