1

I am setting my UITableView frame to be just below another view on the y-axis. I do not want the UITableView to go under the view higher on the y axis, like it would a UINavigationBar. In this image the scroll indicators are at the very top. enter image description here

But As you can see the inset is not at the top of the tableview. I am assuming that this is because the UITableView is normally used at the top of a UINavigationBar and the scrollview insets are adjusted accordingly, but I don't want that. I've tried setting the following to to UIEdgeInsetMake(0,0,0,0), but it does nothing.

tableView.scrollIndicatorInsets

tableView.contentInset

tableView.contentOffset (to CGPointMake(0,0))

I remember seeing something in iOS 7 tech talks about this, but I've searched through them for the past little bit and haven't found it.

Thanks!!

    tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 0, 0) style:UITableViewStyleGrouped];
    tableView.translatesAutoresizingMaskIntoConstraints = NO;
    tableView.delegate = self;
    tableView.dataSource = self;

@"V:|-(NavBarHeight)-[otherView]-(0)-[tableView]-(0)-|"

SirRupertIII
  • 12,324
  • 20
  • 72
  • 121

1 Answers1

3

Could you try to uncheck the properties of the viewcontroller mentioned in the Screenshot according to your need. I hope this might help you,

enter image description here

aToz
  • 2,463
  • 1
  • 24
  • 34
  • Yup, that was my problem. I'm not using Storyboards so I was doing this in code. Didn't realize it would affect each UITableView in that UIViewController. Good to know I guess. If you could it would be nice if you added something like the following to your answer: Put this in your -viewDidLoad; in the UIViewController that has the UITableView. self.edgesForExtendedLayout = UIRectEdgeNone; – SirRupertIII Feb 06 '14 at 05:25