如何使用StoryBoard将UIButton添加为UIBarButtonItem?

问题描述 投票:0回答:1

我在一个快速项目上使用工具栏,不知何故,它有一个分段控件作为BarButtonItem,它工作得很好。

enter image description here

enter image description here

我现在需要做的是在FutureButton下添加2个UIButton,如果可能的话使用堆栈视图。这似乎是可能的,因为它几乎与另一个BarbuttonItem的segcontrol相同。

我在类似的问题上尝试了很多不同的解决方案但是我不能添加任何东西,甚至是用于测试目的的另一个segcontrol,但没有任何运气。

有关如何实现这一点的任何想法?

编辑:添加应用截图

ios swift interface-builder uitoolbar
1个回答
0
投票

enter image description here试试这种方式以下是层次结构

-> UIToolBar 
      -> UIBarButton 
         -> UIView 
           -> UIStackView(vertical with 15 spacing)
             -> 2 UISegmentedControll (you can change as per you need)
© www.soinside.com 2019 - 2024. All rights reserved.