public void HeaderTap(HeaderTapGestureRecognizer recognizer) { var section = recognizer.Section; var state = section.ExpandState; if (section.IsExpandable) { if (state == ExpandState.Opened) section.ExpandState = ExpandState.Closed; else section.ExpandState = ExpandState.Opened; Flip(section); } }
public override UIView GetViewForHeader(UITableView tableView, int sectionIndex) { var section = GetSection(sectionIndex); if (section != null) { if (section.HeaderView == null && !string.IsNullOrEmpty(section.Caption)) { section.HeaderView = CreateHeaderView(tableView, section.Caption); } if (section.HeaderView != null) { if (section.IsExpandable) { section.ArrowView.Bounds = new RectangleF(0, 0, 16, 16); section.ArrowView.Frame = new RectangleF(5, 8, 16, 16); section.HeaderView.Add(section.ArrowView); tapRecognizer = new HeaderTapGestureRecognizer(section, this, _HeaderSelector); section.HeaderView.AddGestureRecognizer(tapRecognizer); Flip(section); } } return section.HeaderView; } return null; }