【问题标题】:Issue with Status bar in UITableViewController (SidebarController)UITableViewController (SidebarController) 中的状态栏问题
【发布时间】:2014-11-23 23:08:48
【问题描述】:

我在侧边栏中使用 UITableViewController,并且我的应用程序中的状态栏为白色。我在我的应用程序中使用带有 SWRevealViewController 的 SidebarDemo 库。一切正常,只有我的问题是当我打开 Sidebar 时,它在顶部显示空白,这在应用程序中有点奇怪,并在下面的屏幕截图中提到。

我尝试通过下面的代码隐藏我的状态栏

 [[UIApplication sharedApplication] setStatusBarHidden:YES];

    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

//    self.edgesForExtendedLayout=UIRectEdgeNone;
//    self.extendedLayoutIncludesOpaqueBars=NO;
//    self.automaticallyAdjustsScrollViewInsets=NO;

    //self.tableView.contentInset = UIEdgeInsetsMake(20.0f, 20.0f, 0.0f, 0.0f);

    self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectZero];

    self.tableView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0);
    self.tableView.contentOffset = CGPointMake(0, -20);

但是 tableView 并没有向上移动。我在 TableView 中具有 Profile 标题的 Sidebar 类是从 UITableViewController 继承的。请告知如何解决此问题。

【问题讨论】:

    标签: ios7 uinavigationbar xcode6 statusbar uistatusbar


    【解决方案1】:

    我也使用过这个侧边栏演示应用程序。我对这个SideBarViewController 有一些问题。我解决了这些问题。在您的情况下,首先尝试更改MainViewController 中状态栏的 tintColor。

    _sidebarButton.tintColor = [UIColor colorWithRed:94.0f/255.0f green:48.0f/255.0f blue:19.0f/255.0f alpha:1.0f];
    

    默认是这样的

    _sidebarButton.tintColor = [UIColor colorWithWhite:0.1f alpha:0.9f];
    

    您还可以将SideBarViewControllerUITableViewController 更改为UIViewController,并在SideBarViewController 中实现UITableViewDelegates,并对Storyboard 中的视图进行所有自定义。这就是我为解决我遇到的问题所做的。

    如果我可以帮助您编写此 SideBar Demo 应用程序代码,请告诉我。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-10-10
      • 1970-01-01
      • 2011-11-24
      • 2013-10-26
      • 2013-09-27
      • 1970-01-01
      • 2021-07-20
      相关资源
      最近更新 更多