UITableView goes under translucent Navigation Bar

前端 未结 14 986
一整个雨季
一整个雨季 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:26

    I combined @Adam Farrell and @Tash Pemhiwa 's solutions, and finally the code below works for me:

    - (void)viewWillAppear:(BOOL)animated
    {
        [super viewWillAppear:animated];
    
        [self adjustEdgeInsetsForTableView];
    }
    
    
    
    - (void)adjustEdgeInsetsForTableView
    {
        if(self.isMovingToParentViewController) {
            self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
        } else {
            self.tableView.contentInset = UIEdgeInsetsMake(64, 0, 0, 0);
        }
    }
    

    Hope this will help people who waste couple of hours on this weird UI behavior.

提交回复
热议问题