10

We have a number of table views (using Xamarin Monotouch Dialog) that are plain (not grouped) and are designed to appear full-width without indents. This all works fine in iOS 7. Using the iOS 8 simulator though, we're getting a slight left indent.

iOS 8 has a new property called LayoutMargins. We're setting that property to zero. Like this:

if (this.TableView.RespondsToSelector(new Selector("setSeparatorInset:")))
    this.TableView.SeparatorInset = UIEdgeInsets.Zero;

if (this.TableView.RespondsToSelector(new Selector("setLayoutMargins:")))
    this.TableView.LayoutMargins = UIEdgeInsets.Zero;

That had some effect - it removed about half the indent. But we're still seeing a slight indent. Is there another property that controls the indent in iOS 8?

Here's a screenshot... enter image description here

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
Ender2050
  • 6,912
  • 12
  • 51
  • 55

2 Answers2

10

According to this post you need to do this on the UITableView and on your UITableViewCell subclasses.

Another person (same post) overrode the LayoutMargins property on the UITableViewCell subclass to always return UIEdgeInsets.Zero.

Community
  • 1
  • 1
poupou
  • 43,413
  • 6
  • 77
  • 174
0

In c#, tableView.SeparatorInset = UIEdgeInsets.Zero;