/// <summary> /// Definition for the Header of the MVVM ObservableTable object /// </summary> /// <returns>The view for header.</returns> /// <param name="tableView">Table view.</param> /// <param name="section">Section.</param> public static UIView GetViewForHeader(UIKit.UITableView tableView, nint section) { var headerView = new UITableViewHeaderFooterView(); headerView.BackgroundColor = UIColor.FromRGB(173, 203, 209); UILabel fn = new UILabel(new CoreGraphics.CGRect(0, 5, 100f, 22f)); fn.Font = UIFont.SystemFontOfSize(14f); fn.TextAlignment = UITextAlignment.Left; fn.TextColor = UIColor.Black; fn.Text = "First Name"; UILabel ln = new UILabel(new CoreGraphics.CGRect(101, 5, 300f, 22f)); ln.Font = UIFont.SystemFontOfSize(14f); ln.TextAlignment = UITextAlignment.Left; ln.TextColor = UIColor.Black; ln.Text = "Last Name"; headerView.Add(fn); headerView.Add(ln); return(headerView); }
public override void WillDisplayHeaderView(UITableView tableView, UIView headerView, nint section) { UITableViewHeaderFooterView view = headerView as UITableViewHeaderFooterView; view.TextLabel.Font = UIFont.BoldSystemFontOfSize(30); view.TextLabel.Text = HeaderTitle + (todayInspection.Count() + upComingInspection.Count()); view.TextLabel.TextColor = UIColor.FromRGB(63, 63, 63); }
public override UIView GetViewForHeader(UITableView tableView, nint section) { var header = new UITableViewHeaderFooterView(); header.TextLabel.TextColor = UIColor.FromRGB(64, 153, 171); header.TextLabel.Text = String.Format("Total Kkalories {0}", viewModel.SumKkal.ToString("F", CultureInfo.InvariantCulture)); return(header); }
public override void WillDisplayHeaderView(UITableView tableView, UIView headerView, nint section) { if (headerView.GetType() == typeof(UITableViewHeaderFooterView)) { UITableViewHeaderFooterView tableViewHeaderFooterView = (UITableViewHeaderFooterView)headerView; tableViewHeaderFooterView.TextLabel.TextColor = UIColor.Black; var font = UIFont.SystemFontOfSize(18); tableViewHeaderFooterView.TextLabel.Font = font; tableViewHeaderFooterView.TextLabel.TextAlignment = UITextAlignment.Natural; } }
public void SetData(IEnumerable <CommitedFileItemViewModel> collections) { Data = collections.GroupBy(x => x.RootPath).Select(x => { var headerView = new UITableViewHeaderFooterView(); headerView.TextLabel.Text = x.Key; return(new TableSectionInformation <CommitedFileItemViewModel, CommitedFileTableViewCell>( new ReactiveList <CommitedFileItemViewModel>(x), CommitedFileTableViewCell.Key, 44f) { Header = new TableSectionHeader(() => headerView, 30f) }); }).ToList(); }
public override UITableViewHeaderFooterView GetFooterView(int section) { var footer = new UITableViewHeaderFooterView (new RectangleF (0, 0, 10, 50)); var buttonLoadMore = new UIButton (UIButtonType.RoundedRect); buttonLoadMore.Frame = new RectangleF (10, 10, 300, 44); buttonLoadMore.SetTitle ("Показать еще", UIControlState.Normal); //todo 200 - ContentSizeForViewInPopover.Width footer.Frame = new RectangleF (0, 0, 200, 64); footer.AddSubview (buttonLoadMore); return footer; }
public override UIView GetViewForHeader(UITableView tableView, int section) { if (!IsIOS5() && _controller.SectionHeaderColor != null) { var reuse = new NSString("customsectionheadercell"); var view = tableView.DequeueReusableHeaderFooterView(reuse); if (view == null) { view = new UITableViewHeaderFooterView(reuse); view.BackgroundView = new UIView { BackgroundColor = _controller.SectionHeaderColor }; } return(view); } else { return(null); } }
public override UIView GetViewForHeader(UITableView tableView, nint section) { if (tableView.NumberOfRowsInSection(section) < 1) { return(null); } var header = tableView.GetHeaderView(section); if (header == null) { header = new UITableViewHeaderFooterView(); } header.TintColor = UIColor.White; header.BackgroundColor = UIColor.White; header.TextLabel.TintColor = UIColor.Clear; header.TextLabel.Font = UIFont.FromName(FontHelper.Roboto_Bold, 16); header.TextLabel.TextColor = ColorHelper.GreyishBrown.ToUIColor(); return(header); }
/// <summary> /// Add count to Mega class section header /// </summary> /// <param name="tableView"></param> /// <param name="section"></param> /// <returns></returns> public override UIView GetViewForHeader(UITableView tableView, nint section) { var headerView = new UITableViewHeaderFooterView(); var count = new UILabel(); var categories = _indexedTableItems[_keys[section]]; var observationCount = 0; foreach (var category in categories) { observationCount += Bindings.ToList().FindAll(binding => binding.Key.Category.Label.Equals(category)).Count; } count.Text = observationCount.ToString(); count.Font = UIFont.GetPreferredFontForTextStyle(UIFontTextStyle.Body); count.AdjustsFontForContentSizeCategory = true; count.SizeToFit(); headerView.AddSubview(count); headerView.SizeToFit(); count.Frame = new CGRect( Constants.TableRowMargin + Constants.CellCountTextXOffset + Constants.ClassLabelWidth + Constants.MegaClassPadding / 2, Constants.MegaClassPadding, count.Frame.Width, count.Frame.Height); return(headerView); }
public override UIView GetViewForHeader(UITableView tableView, int section) { if (!IsIOS5() && _controller.SectionHeaderColor != null) { var reuse = new NSString ("customsectionheadercell"); var view = tableView.DequeueReusableHeaderFooterView (reuse); if (view == null) { view = new UITableViewHeaderFooterView (reuse); view.BackgroundView = new UIView { BackgroundColor = _controller.SectionHeaderColor }; } return view; } else { return null; } }
public override void WillDisplayHeaderView(UITableView tableView, UIView headerView, nint section) { UITableViewHeaderFooterView header = (UITableViewHeaderFooterView)headerView; header.TextLabel.Font = UIFont.BoldSystemFontOfSize(13); }
void AddHeader() { var header = new UITableViewHeaderFooterView(); header.TextLabel.Text = "Crayon Examples"; header.SetStyleId("sample-table-header"); TableView.TableHeaderView = header; }
void ShowSelector(string selectorTitle, string selectorSubtitle, UITableViewSource tableViewSource, string footerButtonTitle = "", Action doneAction = null, Action footerButtonAction = null) { try { UILabel selectorTitleLabel = new UILabel(); UILabel selectorSubtitleLabel = new UILabel(); UIButton doneButton = new UIButton(UIButtonType.System); UIButton footerButton = new UIButton(UIButtonType.System); UITableViewHeaderFooterView tableHeader = new UITableViewHeaderFooterView(); UITableViewHeaderFooterView tableFooter = new UITableViewHeaderFooterView(); if (selectorTableView != null) { selectorTableView.RemoveFromSuperview(); selectorTableView.Dispose(); } tableHeader.Frame = new CGRect(20, 0, View.Window.Frame.Width - 20, 50); tableFooter.Frame = new CGRect(0, 0, View.Window.Frame.Width - 20, 50); selectorTitleLabel.Text = selectorTitle; selectorTitleLabel.TextColor = UIColor.Black; selectorTitleLabel.AdjustsFontSizeToFitWidth = true; selectorTitleLabel.Frame = new CGRect(15, -5, tableHeader.Frame.Width / 2, 50); selectorSubtitleLabel.TextColor = UIColor.LightGray; selectorSubtitleLabel.Text = selectorSubtitle; selectorSubtitleLabel.Frame = new CGRect(15, 10, tableHeader.Frame.Width / 2, 50); selectorSubtitleLabel.Font = UIFont.SystemFontOfSize(10); doneButton.SetTitle("Done", UIControlState.Normal); doneButton.Font.WithSize(12); footerButton.SetTitle(footerButtonTitle, UIControlState.Normal); footerButton.Font.WithSize(12); doneButton.TouchUpInside += (sender, e) => { selectorTableView.Hidden = true; doneAction?.Invoke(); ControlMenu("Show"); gameLayer.GamePaused = false; }; doneButton.Frame = new CGRect(tableHeader.Frame.Width - doneButton.Frame.Width - 58, 10, 50, 30); footerButton.TouchUpInside += (sender, e) => { selectorTableView.Hidden = true; footerButtonAction?.Invoke(); ControlMenu("Show"); gameLayer.GamePaused = false; }; footerButton.Frame = new CGRect(3, 20, 100, 20); tableHeader.Add(selectorTitleLabel); tableHeader.Add(selectorSubtitleLabel); tableHeader.Add(doneButton); tableFooter.Add(footerButton); selectorTableView = new UITableView(); selectorTableView.Layer.BorderColor = new CGColor(0.7f, 0.7f, 0.7f, 0.8f); selectorTableView.Layer.BorderWidth = 1; selectorTableView.Layer.CornerRadius = 8; selectorTableView.BackgroundColor = new UIColor(1, 1, 1, 0.8f); selectorTableView.TableHeaderView = tableHeader; selectorTableView.TableFooterView = tableFooter; selectorTableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; selectorTableView.Frame = new CGRect(0, 0, View.Window.Frame.Width - 20, (selectorTableView.ContentSize.Height + 50 < 270 ? selectorTableView.ContentSize.Height + 50 : 270)); selectorTableView.Center = new CGPoint(View.Window.Frame.Width / 2, View.Window.Frame.Height / 2); selectorTableView.Source = tableViewSource; if (philipsHue.ColorBulbs.Count > 5) { selectorTableView.ScrollEnabled = true; selectorTableView.ScrollsToTop = true; selectorTableView.ShowsVerticalScrollIndicator = true; selectorTableView.ShowsHorizontalScrollIndicator = false; selectorTableView.FlashScrollIndicators(); } Add(selectorTableView); } catch (Exception ex) { throw ex; } }