Posts

Showing posts from November, 2014

Separator Insets on UITableView in iOS8 - Xamarin.iOS

In iOS7 it was possible to configure the separator insets by setting the separator inset property on the tableview: tableView.SeparatorInsets = new UIEdgeInsets(0, 0, 0, 0) In iOS8 this no longer works and you need to set the LayoutMargins on both the table and the cell remembering to check if the property is supported first to avoid breaking iOS7 if   ( this .T ableView . RespondsToSelector ( new   Selector ( " setLayoutMargins : " )))     this .T ableView . LayoutMargins   =   new   UIEdgeInsets ( 0 ,   0 ,   0 ,   0 ) ; Commonly the cell separator insets are set by overriding WillDisplay public   override   void   WillDisplay ( UITableView   tableView ,   UITableViewCell   cell ,   NSIndexPath   indexPath ) {     if   (c ell . RespondsToSelector ( new   Selector ( " setLayoutMargins : " )))         c ell . LayoutMargins   =   new   UIEdgeInsets ( 0 ,   0 ,   0 ,   0 ) ; } Hopefully this won't change again with iOS9...