ios - 如何在 Storyboard 中的 UITableViewController 底部添加工具栏?

标签 ios iphone objective-c uitableview uiview

在我使用 Storyboards 设置的 UITableView 中,我需要能够添加一个固定在 View 底部的工具栏,它不应该滚动。

与此问题不同:LINK我不认为我可以将 TableView subview 添加到普通 View 中,然后以编程方式添加工具栏,因为我使用的是动态单元格,这似乎更容易通过 Storyboards 集成。

目前,这就是我所坚持的...... enter image description here

最佳答案

如果您想在放置在某个导航 Controller 中的一个 View Controller 中显示工具栏。

  1. 在 Storyboard 中选择 View Controller
  2. 在实用程序中,显示“属性检查器”。选择“底栏”样式。
  3. 添加栏按钮项
  4. 在 View Controller 中添加代码,显示和隐藏工具栏:

代码:

- (void)viewWillAppear:(BOOL)animated
{
    [self.navigationController setToolbarHidden:NO animated:YES];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [self.navigationController setToolbarHidden:YES animated:YES];
}

关于ios - 如何在 Storyboard 中的 UITableViewController 底部添加工具栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19625416/

相关文章:

ios - 在 iOS 开发的上下文中,什么是配置/makefile 脚本的好书或引用?

ios - 添加和删​​除 NSNotificationCenter Observer - UIApplicationDidEnterBackgroundNotification - 正确的方法?

ios - react native 按钮单击移动到另一个屏幕

ios - UIAlertController 下最顶层的 ViewController

html - 背景图像在 iPhone 上显示不正确(居中)

iphone - 使用按钮更改页面控件

ios - 如果他们过去调用并且会延迟显示数据,如何在 iOS 中退出循环的 NSTimer?

iphone - iOS - 如何将 UIImage 和 UILabel 作为页脚放在同一行?

ios - UIView 的 initWithFrame

ios - 正确解码字符串 url 以在 NSURL 中进行转换