UISplitView 和底部的自定义工具栏
所以我有一个分割视图控制器,并尝试以编程方式将工具栏放在根视图的底部。我目前正在使用 [self.tableView setTableFooterView:toolbar];
方法将其添加到表格底部。这可以很好地将工具栏显示在屏幕上,但它没有固定在视图的底部。它始终出现在表中最后一个元素之后。我将如何将其锚定到根视图的底部?我应该将框架设置到视图的底部,然后将其作为子视图添加到根视图本身吗?或者我可以只调整框架并将其保留为 TableFooterView 的组件吗?谢谢
So I have a Split View controller and am trying to put a toolbar at the bottom of my root view programmatically. I am currently adding it to the bottom of the table using the [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? Or can I just adjust the frame and leave it as a component of the TableFooterView? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的问题有正确的解决方案。
将工具栏的框架设置为根视图的底部。通过调用以下命令确保它是最前面的视图:
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: