简体   繁体   English

UISplitView和底部的自定义工具栏

[英]UISplitView and custom toolbar at bottom

So I have a Split View controller and am trying to put a toolbar at the bottom of my root view programmatically. 因此,我有一个Split View控制器,并尝试以编程方式将工具栏放在根视图的底部。 I am currently adding it to the bottom of the table using the [self.tableView setTableFooterView:toolbar]; 我目前正在使用[self.tableView setTableFooterView:toolbar];将其添加到表格的底部[self.tableView setTableFooterView:toolbar]; method. 方法。 This works fine getting the toolbar on the screen, but it is not anchored to the bottom of the view. 将工具栏显示在屏幕上可以很好地工作,但是它并不固定在视图的底部。 It always appears after the last element in the table. 它总是出现在表中的最后一个元素之后。 How would I go about anchoring it to the bottom of the root view? 我将如何将其锚定到根视图的底部? Should I set the frame to the bottom of the view, and then add it as a subview to the rootview itself? 我应该将框架设置在视图的底部,然后将其作为子视图添加到rootview本身吗? Or can I just adjust the frame and leave it as a component of the TableFooterView? 还是可以只调整框架并将其保留为TableFooterView的一部分? Thanks 谢谢

You have the right solution in your question. 您有正确的解决方案。

Set the frame of your toolbar to the bottom of your root view. 将工具栏的框架设置为根视图的底部。 Be sure and make sure it's the frontmost view by calling: 通过调用以下命令确保并确保它是最前面的视图:

[myRootView bringSubviewToFront:myBarView];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM