Reputation: 9841
I am new to iOS development, and my code is running fine in iOS6, but in iOS7 it has some UI issues.
Please see following image. I wanted to add margin to table view, but as stated it was perfect in iOS 6. Question may seem very basic, but I am trying to find any property using which I can add margin.
Secondly, if I need to do it programmatically, please suggest where I should write the code.
I tried to search on google, but may be I am not able to search with correct terms. I am C++ developer and new to Objective C and Mac.
Upvotes: 6
Views: 7483
Reputation: 58448
On your table view controller, set the edgesForExtendedLayout
property to UIRectEdgeTop
.
You can use this property to extend views beneath top bars, (status and navigation bars) and bottom bars (toolbars and tab bars).
The value is a bit mask with possible values of:
UIRectEdgeNone,
UIRectEdgeTop,
UIRectEdgeLeft,
UIRectEdgeRight,
UIRectEdgeBottom,
UIRectEdgeAll
Upvotes: 0
Reputation: 414
You can do this by setting your tableViews contentInset or contentOffset depending on your needs.
[self.tableView setContentInset:UIEdgeInsetsMake(top, left, bottom, right)];
Upvotes: 7