iOS 7 Custom TableView Is Under TabBar

后端 未结 16 1643
萌比男神i
萌比男神i 2020-12-13 04:31

Im trying port my app to iOS7, but my custom TableViewController is showing the last row (cell) under the TabBar :(

Im searchi

相关标签:
16条回答
  • 2020-12-13 05:15

    For those like xarly who want the translucent effect, and for an Autolayout solution (without setting frames), see my answer here https://stackoverflow.com/a/26419986/1158074

    0 讨论(0)
  • 2020-12-13 05:16

    In iOS 7 viewController uses full height. There is a property introduced as

    self.automaticallyAdjustsScrollViewInsets = NO;
    

    set it to no. then check, or set UIEdgeInset if is not set right after it.

    UIEdgeInsetsMake(top, left, bottom, right)
    

    See here https://developer.apple.com/library/ios/documentation/userexperience/conceptual/TransitionGuide/AppearanceCustomization.html

    Edit: try also this

    self.edgesForExtendedLayout = UIRectEdgeNone;
    
    0 讨论(0)
  • 2020-12-13 05:21

    maybe is not a right answer, also for that reason I post this answer so you can tell me if this answer could be a possible solution.

    In my case, I like the translucent effect, so I have added a footer in the table and I have modified the scrollIndicators.

    - (void)viewDidLoad
    {
        // Do any additional setup after loading the view.
        [super viewDidLoad];
        UIView *footer = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.agendaItemsTable.frame.size.width, self.tabBarController.tabBar.frame.size.height)];
        self.agendaItemsTable.tableFooterView = footer;
        self.agendaItemsTable.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, self.tabBarController.tabBar.frame.size.height, 0);
    
    }
    

    What do you think?

    0 讨论(0)
  • 2020-12-13 05:24

    I've got the same problem and solved it using storyboard. At Tab Bar Controller, go to attribute inspector, Simulated Metrics, and set the Bottom Bar to Opaque Tab Bar. That's it! See image bellow for description. enter image description here

    Saudações! (Greetings!)

    0 讨论(0)
  • 2020-12-13 05:26

    I found the answer to your question on another post, answered by dariaa, here:

    Tab Bar covers TableView cells in iOS7

    It worked great for me.

    Please no credit for me, because I'm not the original guy who solved it.

    In your custom TableViewController, add these two lines under [super viewDidLoad]:

    - (void)viewDidLoad
    {
        [super viewDidLoad];
    
        self.edgesForExtendedLayout = UIRectEdgeAll;
        self.tableView.contentInset = UIEdgeInsetsMake(0., 0., CGRectGetHeight(self.tabBarController.tabBar.frame), 0); 
    } 
    
    0 讨论(0)
  • 2020-12-13 05:29

    Try the following:

     if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
    
     self.edgesForExtendedLayout = UIRectEdgeBottom;
    
    0 讨论(0)
提交回复
热议问题