void SetUpTableView() { tableView = new UITableView { TranslatesAutoresizingMaskIntoConstraints = false, AllowsSelection = false }; tableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; tableView.RegisterClassForCellReuse(typeof(IncomingCell), IncomingCell.CellId); tableView.RegisterClassForCellReuse(typeof(OutgoingCell), OutgoingCell.CellId); View.AddSubview(tableView); var pinLeft = NSLayoutConstraint.Create(tableView, NSLayoutAttribute.Leading, NSLayoutRelation.Equal, View, NSLayoutAttribute.Leading, 1, 0); View.AddConstraint(pinLeft); var pinRight = NSLayoutConstraint.Create(tableView, NSLayoutAttribute.Trailing, NSLayoutRelation.Equal, View, NSLayoutAttribute.Trailing, 1, 0); View.AddConstraint(pinRight); var pinTop = NSLayoutConstraint.Create(tableView, NSLayoutAttribute.Top, NSLayoutRelation.Equal, TopLayoutGuide, NSLayoutAttribute.Bottom, 1, 0); View.AddConstraint(pinTop); var pinBottom = NSLayoutConstraint.Create(tableView, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, View, NSLayoutAttribute.Bottom, 1, 0); View.AddConstraint(pinBottom); tableSource = new ChatSource(viewModel); tableView.Source = tableSource; }
void SetUpTableView() { tableView = new UITableView { TranslatesAutoresizingMaskIntoConstraints = false, AllowsSelection = false }; tableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; tableView.RegisterClassForCellReuse (typeof(IncomingCell), IncomingCell.CellId); tableView.RegisterClassForCellReuse (typeof(OutgoingCell), OutgoingCell.CellId); View.AddSubview (tableView); var pinLeft = NSLayoutConstraint.Create (tableView, NSLayoutAttribute.Leading, NSLayoutRelation.Equal, View, NSLayoutAttribute.Leading, 1, 0); View.AddConstraint (pinLeft); var pinRight = NSLayoutConstraint.Create (tableView, NSLayoutAttribute.Trailing, NSLayoutRelation.Equal, View, NSLayoutAttribute.Trailing, 1, 0); View.AddConstraint (pinRight); var pinTop = NSLayoutConstraint.Create (tableView, NSLayoutAttribute.Top, NSLayoutRelation.Equal, TopLayoutGuide, NSLayoutAttribute.Bottom, 1, 0); View.AddConstraint (pinTop); var pinBottom = NSLayoutConstraint.Create (tableView, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, View, NSLayoutAttribute.Bottom, 1, 0); View.AddConstraint (pinBottom); tableSource = new ChatSource (viewModel); tableView.Source = tableSource; }