1

My app contains only one UISplitViewController. Now I want to add a floating button on top of the window. But it is not possible to use the storyboard to drag a button to the UITableViewController of the master view, because by default, the master view contains only a UITableView.

How can I do it?

enter image description here

4

1 回答 1

1

您只需要在拆分视图控制器之前创建一个新的视图控制器。在这个新控制器中添加顶部的按钮并添加容器视图以填充视图的其余部分。

故事板

然后通过 viewDidLoad/embed 创建从容器视图到拆分视图控制器的 segue

在此处输入图像描述

就这样!

在此处输入图像描述

于 2017-08-15T09:12:10.100 回答