UITableView goes under translucent Navigation Bar

前端 未结 14 1127
一整个雨季
一整个雨季 2020-12-22 23:51

I am trying to have a transparent navigation bar in IOS 7 app. There is a full screen image in my application. I am also having a UITableView over that image. When I use the

14条回答
  •  渐次进展
    2020-12-23 00:10

    This is working in both landscape mode and portrait mode in iOS8:

    - (void)viewDidLayoutSubviews
    {
      [super viewDidLayoutSubviews];
    
      CGRect rect = self.navigationController.navigationBar.frame;
    
      float y = -rect.origin.y;
    
      self.tableView.contentInset = UIEdgeInsetsMake(y ,0,0,0);
    }
    

提交回复
热议问题