iPhone - 分离的 UI 导航栏项目

发布于 2024-09-02 13:57:45 字数 213 浏览 3 评论 0原文

替代文本

对于 Mail.app 中看到的 UINavigationbar 的这种分离控件,是否有现有的 API?更具体地说,如图所示的向上和向下箭头。

alt text

Is there an existing API for this kind of separated controls for the UINavigationbar seen in Mail.app? More specifically this up and down arrows shown in the picture.

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

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

发布评论

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

评论(1

固执像三岁 2024-09-09 13:57:45

请注意,您可以使用任何所需的自定义视图创建 UIBarButtonItem。因此,您也可以使用 UISegmentedControl 创建它 - 它可能在您的示例中使用。工作流程应该类似于:

  1. 创建瞬时(momentary 属性设置为 yes),具有 2 个段的 UISegmentedControl
  2. 为每个段分配一个图像(使用 setImage:forSegmentAtIndex: 方法)。然后
  3. 创建使用此 UISegmentedControl 作为自定义视图初始化的 UIBarButtonItem (使用 initWithCustomView: 方法)。
  4. 将 UIBarButtonItem 作为左或右 BarButtonItem 添加到 UINavigationItem

Note that you can create UIBarButtonItem with any custom view you want. So you can create it with UISegmentedControl as well - it is what's likely used in your example. Workflow should be something like:

  1. Create momentary (momentary property set to yes) UISegmentedControl with 2 segments
  2. Assign an image to each of them (using setImage:forSegmentAtIndex: method). Then
  3. Create UIBarButtonItem initialized with this UISegmentedControl as a custom view (using initWithCustomView: method).
  4. Add your UIBarButtonItem as a left or right BarButtonItem to the UINavigationItem
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文