protected virtual IVisualElementRenderer GetNewRenderer() { IVisualElementRenderer newRenderer = Platform.CreateRenderer(_formsCell); _rendererRef = new WeakReference <IVisualElementRenderer>(newRenderer); ContentView.AddSubview(newRenderer.NativeView); UIView native = newRenderer.NativeView; native.TranslatesAutoresizingMaskIntoConstraints = false; native.TopAnchor.ConstraintEqualTo(ContentView.TopAnchor).Active = true; native.LeftAnchor.ConstraintEqualTo(ContentView.LeftAnchor).Active = true; native.BottomAnchor.ConstraintEqualTo(ContentView.BottomAnchor).Active = true; native.RightAnchor.ConstraintEqualTo(ContentView.RightAnchor).Active = true; return(newRenderer); }
public VideoCell(CGRect frame) : base(frame) { BackgroundView = new UIView { BackgroundColor = UIColor.Orange }; SelectedBackgroundView = new UIView { BackgroundColor = UIColor.Green }; ContentView.Layer.BorderColor = UIColor.White.CGColor; ContentView.Layer.BorderWidth = 1.0f; ContentView.BackgroundColor = UIColor.White; imageView = new UIImageView(UIImage.FromBundle("0.jpg")); ContentView.AddSubview(imageView); }
public void InitStyle() { ivContent.Layer.CornerRadius = 6f; ivContent.Layer.MasksToBounds = true; lblTitle.Font = iOS.Appearance.Fonts.LatoBoldWithSize(14); lblCheck.Font = iOS.Appearance.Fonts.LatoWithSize(14); lblDate.Font = iOS.Appearance.Fonts.LatoWithSize(14); var separatorLineView = new UIView(new CGRect(115, 0, this.ContentView.Frame.Width, 1)) { BackgroundColor = UIColor.FromRGB(232, 232, 232) }; // #e8e8e8 ContentView.AddSubview(separatorLineView); }
public UIFriendlyDateHeaderCell(string cellId) : base(cellId) { // Don't allow clicking on this header cell UserInteractionEnabled = false; ContentView.BackgroundColor = UIColorCompat.SecondarySystemBackgroundColor; _labelText = new UILabel() { TranslatesAutoresizingMaskIntoConstraints = false, Font = UIFont.PreferredSubheadline, TextColor = UIColorCompat.SecondaryLabelColor }; ContentView.AddSubview(_labelText); _labelText.StretchWidthAndHeight(ContentView, left: 16, top: 8, bottom: 8); ContentView.SetHeight(44); }
void Configure() { Label = new UILabel { TranslatesAutoresizingMaskIntoConstraints = false, AdjustsFontForContentSizeCategory = true, Font = UIFont.GetPreferredFontForTextStyle(UIFontTextStyle.Body) }; ContentView.AddSubview(Label); Layer.BorderWidth = 1; Layer.BorderColor = UIColor.SystemGray2Color.CGColor; var inset = 10; Label.LeadingAnchor.ConstraintEqualTo(ContentView.LeadingAnchor, inset).Active = true; Label.TrailingAnchor.ConstraintEqualTo(ContentView.TrailingAnchor, -inset).Active = true; Label.CenterYAnchor.ConstraintEqualTo(ContentView.CenterYAnchor).Active = true; }
public ManufacturerCell(CGRect frame) : base(frame) { BackgroundView = new UIView { BackgroundColor = UIColor.White, Alpha = (nfloat).5 }; BackgroundView.Layer.CornerRadius = 6.0f; SelectedBackgroundView = new UIView { BackgroundColor = UIColor.Green, Alpha = (nfloat).5 }; SelectedBackgroundView.Layer.CornerRadius = 6.0f; ContentView.Layer.BorderColor = UIColor.LightGray.CGColor; ContentView.Layer.BorderWidth = 3.0f; ContentView.Layer.CornerRadius = 6.0f; //ContentView.BackgroundColor = UIColor.White; //ContentView.Alpha = (nfloat).5; ContentView.Layer.ShadowColor = UIColor.DarkGray.CGColor; ContentView.Layer.ShadowOpacity = 1.0f; ContentView.Layer.ShadowRadius = 6.0f; ContentView.Layer.ShadowOffset = new System.Drawing.SizeF(0f, 3f); //ContentView.Transform = CGAffineTransform.MakeScale(0.8f, 0.8f); //ContentView.Transform = CGAffineTransform.MakeScale(2f, 2f); imageView = new UIImageView(new CGRect(0, frame.Height / 4, frame.Width - 10, frame.Height / 2)); imageView.ContentMode = UIViewContentMode.ScaleAspectFit; imageView.Image = UIImage.FromBundle("airplane.png"); //imageView = new UIImageView(UIImage.FromBundle("airplane.png")); //imageView = new UIImageView(UIImage.FromBundle("airplane.png")); imageView.Center = ContentView.Center; //imageView.Transform = CGAffineTransform.MakeScale(0.7f, 0.7f); //imageView.Transform = CGAffineTransform.MakeScale(1.8f, 1.8f); manufacturerLabel = new UILabel(new CGRect(0, 5, frame.Width, frame.Height / 5)); manufacturerLabel.TextAlignment = UITextAlignment.Center; ContentView.AddSubview(imageView); ContentView.AddSubview(manufacturerLabel); }
public void ShowAll() { this.header_text_field.StringValue = Header; this.description_text_field.StringValue = Description; ContentView.AddSubview(this.header_text_field); if (!string.IsNullOrEmpty(Description)) { ContentView.AddSubview(this.description_text_field); } ContentView.AddSubview(this.side_splash_view); int i = 1; int x = 0; if (Buttons.Count > 0) { DefaultButtonCell = Buttons [0].Cell; foreach (NSButton button in Buttons) { button.BezelStyle = NSBezelStyle.Rounded; button.Frame = new RectangleF(Frame.Width - 15 - x - (105 * i), 12, 105, 32); // Make the button a bit wider if the text is // likely to be longer if (button.Title.Contains(" ")) { button.SizeToFit(); button.Frame = new RectangleF(Frame.Width - 30 - 15 - (105 * (i - 1)) - button.Frame.Width, 12, button.Frame.Width + 30, 32); x += 22; } button.Font = SparkleUI.Font; ContentView.AddSubview(button); i++; } } RecalculateKeyViewLoop(); }
public void Relayout(SizeF new_window_size) { InvokeOnMainThread(delegate { this.web_view.Frame = new RectangleF(this.web_view.Frame.Location, new SizeF(new_window_size.Width, new_window_size.Height - TitlebarHeight - 39)); this.background.Frame = new RectangleF(this.background.Frame.Location, new SizeF(new_window_size.Width, new_window_size.Height - TitlebarHeight - 37)); this.size_label.Frame = new RectangleF( new PointF(this.size_label.Frame.X, new_window_size.Height - TitlebarHeight - 30), this.size_label.Frame.Size ); this.size_label_value.Frame = new RectangleF( new PointF(this.size_label_value.Frame.X, new_window_size.Height - TitlebarHeight - 30), this.size_label_value.Frame.Size ); this.history_label.Frame = new RectangleF( new PointF(this.history_label.Frame.X, new_window_size.Height - TitlebarHeight - 30), this.history_label.Frame.Size ); this.history_label_value.Frame = new RectangleF( new PointF(this.history_label_value.Frame.X, new_window_size.Height - TitlebarHeight - 30), this.history_label_value.Frame.Size ); this.popup_button.RemoveFromSuperview(); // Needed to prevent redraw glitches this.popup_button.Frame = new RectangleF( new PointF(new_window_size.Width - this.popup_button.Frame.Width - 12, new_window_size.Height - TitlebarHeight - 33), this.popup_button.Frame.Size ); ContentView.AddSubview(this.popup_button); this.progress_indicator.Frame = new RectangleF( new PointF(new_window_size.Width / 2 - 10, this.web_view.Frame.Height / 2 + 10), this.progress_indicator.Frame.Size ); }); }
public ImageCell(RectangleF frame) : base(frame) { ImageView = new UIImageView(); ImageView.Layer.BorderColor = UIColor.DarkGray.CGColor; ImageView.Layer.BorderWidth = 1f; ImageView.Layer.CornerRadius = 3f; ImageView.Layer.MasksToBounds = true; ImageView.ContentMode = UIViewContentMode.ScaleToFill; ContentView.AddSubview(ImageView); LabelView = new UILabel(); LabelView.BackgroundColor = UIColor.Clear; LabelView.TextColor = UIColor.DarkGray; LabelView.TextAlignment = UITextAlignment.Center; ContentView.AddSubview(LabelView); }
public TTTProfileIconTableViewCell(UITableViewCellStyle style, string reuseIdentifier) : base(style, reuseIdentifier) { UIImage x = TTTProfile.ImageForIcon(TTTProfileIcon.X). ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal); UIImage o = TTTProfile.ImageForIcon(TTTProfileIcon.O). ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal); SegmentedControl = new UISegmentedControl(new object[] { x, o }) { Frame = new RectangleF(0, 0, 240, 80), AutoresizingMask = UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleBottomMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin }; UIEdgeInsets capInsets = new UIEdgeInsets(6f, 6f, 6f, 6f); SegmentedControl.SetBackgroundImage( UIImage.FromBundle("segmentBackground").CreateResizableImage(capInsets), UIControlState.Normal, UIBarMetrics.Default); SegmentedControl.SetBackgroundImage( UIImage.FromBundle("segmentBackgroundHighlighted").CreateResizableImage(capInsets), UIControlState.Highlighted, UIBarMetrics.Default); SegmentedControl.SetBackgroundImage( UIImage.FromBundle("segmentBackgroundSelected").CreateResizableImage(capInsets), UIControlState.Selected, UIBarMetrics.Default); SegmentedControl.SetDividerImage( UIImage.FromBundle("segmentDivider"), UIControlState.Normal, UIControlState.Normal, UIBarMetrics.Default); UIView containerView = new UIView(SegmentedControl.Frame) { Frame = ContentView.Bounds, AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight }; containerView.AddSubview(SegmentedControl); ContentView.AddSubview(containerView); }
internal UIContainerCell(string cellId, View view, Shell shell, object context) : base(UITableViewCellStyle.Default, cellId) { View = view; View.MeasureInvalidated += MeasureInvalidated; SelectionStyle = UITableViewCellSelectionStyle.None; _renderer = Platform.CreateRenderer(view); Platform.SetRenderer(view, _renderer); ContentView.AddSubview(_renderer.NativeView); _renderer.NativeView.ClipsToBounds = true; ContentView.ClipsToBounds = true; BindingContext = context; if (shell != null) { shell.AddLogicalChild(View); } }
public SessionCell(string reuseIdentifier) : base(UITableViewCellStyle.Default, reuseIdentifier) { titleLabel = new UILabel { Font = UIFont.FromName("Avenir-Light", 16.0f), BackgroundColor = UIColor.Clear }; timeLabel = new UILabel { Font = UIFont.FromName("Avenir-Light", 14.0f), TextColor = UIColor.DarkGray, BackgroundColor = UIColor.Clear }; speakerLabel = new UILabel { Font = UIFont.FromName("Avenir-Light", 14.0f), BackgroundColor = UIColor.Clear }; ContentView.AddSubview(titleLabel); ContentView.AddSubview(timeLabel); ContentView.AddSubview(speakerLabel); favoriteImageView = new UIImageView(); ContentView.AddSubview(favoriteImageView); }
public InventoryPanel(GameDesktop Desktop) { Name = "Inventory"; Bounds = new Rectangle(0, 0, 176, 200); for (InventorySlot slot = InventorySlot.First; slot <= InventorySlot.Last; slot++) { InventoryItemButton InventoryItem = new InventoryItemButton(Viewport, slot) { Bounds = GetSlotPosition(slot) }; InventoryItem.Autoresizable = false; ContentView.AddSubview(InventoryItem); } this.Desktop = Desktop; Desktop.ActiveViewportChanged += ViewportChanged; ViewportChanged(Desktop.ActiveViewport); }
public Note() : base() { SetFrame(new CGRect(0, 0, 480, 240), true); Center(); Delegate = new SparkleNoteDelegate(); StyleMask = (NSWindowStyle.Closable | NSWindowStyle.Titled); Title = "Add Note"; MaxSize = new CGSize(480, 240); MinSize = new CGSize(480, 240); HasShadow = true; IsOpaque = false; BackingType = NSBackingStore.Buffered; Level = NSWindowLevel.Floating; this.hidden_close_button = new NSButton() { Frame = new CGRect(0, 0, 0, 0), KeyEquivalentModifierMask = NSEventModifierMask.CommandKeyMask, KeyEquivalent = "w" }; CreateNote(); this.hidden_close_button.Activated += delegate { Controller.WindowClosed(); }; Controller.HideWindowEvent += delegate { SparkleShare.Controller.Invoke(() => PerformClose(this)); }; Controller.ShowWindowEvent += delegate { SparkleShare.Controller.Invoke(() => OrderFrontRegardless()); CreateNote(); }; Controller.UpdateTitleEvent += delegate(string title) { SparkleShare.Controller.Invoke(() => { Title = title; }); }; ContentView.AddSubview(this.hidden_close_button); }
protected void InitializeContentConstraints(UIView nativeView) { ContentView.TranslatesAutoresizingMaskIntoConstraints = false; nativeView.TranslatesAutoresizingMaskIntoConstraints = false; ContentView.AddSubview(nativeView); // We want the cell to be the same size as the ContentView ContentView.TopAnchor.ConstraintEqualTo(TopAnchor).Active = true; ContentView.BottomAnchor.ConstraintEqualTo(BottomAnchor).Active = true; ContentView.LeadingAnchor.ConstraintEqualTo(LeadingAnchor).Active = true; ContentView.TrailingAnchor.ConstraintEqualTo(TrailingAnchor).Active = true; // And we want the ContentView to be the same size as the root renderer for the Forms element ContentView.TopAnchor.ConstraintEqualTo(nativeView.TopAnchor).Active = true; ContentView.BottomAnchor.ConstraintEqualTo(nativeView.BottomAnchor).Active = true; ContentView.LeadingAnchor.ConstraintEqualTo(nativeView.LeadingAnchor).Active = true; ContentView.TrailingAnchor.ConstraintEqualTo(nativeView.TrailingAnchor).Active = true; }
public void UpdateContent(string html) { using (NSAutoreleasePool pool = new NSAutoreleasePool()) { Thread thread = new Thread(new ThreadStart(delegate { if (html == null) { html = Controller.HTML; } html = html.Replace("<!-- $body-font-family -->", "Lucida Grande"); html = html.Replace("<!-- $day-entry-header-font-size -->", "13.6px"); html = html.Replace("<!-- $body-font-size -->", "13.4px"); html = html.Replace("<!-- $secondary-font-color -->", "#bbb"); html = html.Replace("<!-- $small-color -->", "#ddd"); html = html.Replace("<!-- $day-entry-header-background-color -->", "#f5f5f5"); html = html.Replace("<!-- $a-color -->", "#0085cf"); html = html.Replace("<!-- $a-hover-color -->", "#009ff8"); html = html.Replace("<!-- $no-buddy-icon-background-image -->", "file://" + Path.Combine(NSBundle.MainBundle.ResourcePath, "Pixmaps", "avatar-default.png")); html = html.Replace("<!-- $document-added-background-image -->", "file://" + Path.Combine(NSBundle.MainBundle.ResourcePath, "Pixmaps", "document-added-12.png")); html = html.Replace("<!-- $document-deleted-background-image -->", "file://" + Path.Combine(NSBundle.MainBundle.ResourcePath, "Pixmaps", "document-deleted-12.png")); html = html.Replace("<!-- $document-edited-background-image -->", "file://" + Path.Combine(NSBundle.MainBundle.ResourcePath, "Pixmaps", "document-edited-12.png")); html = html.Replace("<!-- $document-moved-background-image -->", "file://" + Path.Combine(NSBundle.MainBundle.ResourcePath, "Pixmaps", "document-moved-12.png")); InvokeOnMainThread(delegate { if (this.progress_indicator.Superview == ContentView) { this.progress_indicator.RemoveFromSuperview(); } this.web_view.MainFrame.LoadHtmlString(html, new NSUrl("")); ContentView.AddSubview(this.web_view); }); })); thread.Start(); } }
public About() : base() { SetFrame(new RectangleF(0, 0, 640, 281), true); Center(); Delegate = new SparkleAboutDelegate(); StyleMask = (NSWindowStyle.Closable | NSWindowStyle.Titled); Title = "About SparkleShare"; MaxSize = new SizeF(640, 281); MinSize = new SizeF(640, 281); HasShadow = true; IsOpaque = false; BackingType = NSBackingStore.Buffered; Level = NSWindowLevel.Floating; this.hidden_close_button = new NSButton() { Frame = new RectangleF(0, 0, 0, 0), KeyEquivalentModifierMask = NSEventModifierMask.CommandKeyMask, KeyEquivalent = "w" }; CreateAbout(); this.hidden_close_button.Activated += delegate { Controller.WindowClosed(); }; Controller.HideWindowEvent += delegate { SparkleShare.Controller.Invoke(() => PerformClose(this)); }; Controller.ShowWindowEvent += delegate { SparkleShare.Controller.Invoke(() => OrderFrontRegardless()); }; Controller.UpdateLabelEvent += delegate(string text) { SparkleShare.Controller.Invoke(() => { this.updates_text_field.StringValue = text; }); }; ContentView.AddSubview(this.hidden_close_button); }
protected SwipeableCell(IntPtr hwnd) : base(hwnd) { var deleteRecognizer = new UIPanGestureRecognizer(SwipeHandler) { ShouldBegin = ShouldBegin }; AddGestureRecognizer(deleteRecognizer); var label = new UILabel(ContentView.Frame); ContentView.AddSubview(label); this.DelayBind(() => { var bindings = this.CreateBindingSet <SwipeableCell, MyItemViewModel>(); bindings.Bind(label).To(vm => vm.Text); bindings.Apply(); }); }
public NativeCustomCell(Cell formsCell) : base(UIKit.UITableViewCellStyle.Default, formsCell.GetType().FullName) { Cell = formsCell; //UILabelの生成と配置 _titleLabel = new UILabel(); ContentView.AddSubview(_titleLabel); _titleLabel.TranslatesAutoresizingMaskIntoConstraints = false; _titleLabel.CenterXAnchor.ConstraintEqualTo(ContentView.CenterXAnchor).Active = true; _titleLabel.CenterYAnchor.ConstraintEqualTo(ContentView.CenterYAnchor).Active = true; var tap = new UITapGestureRecognizer(_ => { CustomCell.Command?.Execute(_titleLabel.Text); }); _titleLabel.AddGestureRecognizer(tap); _titleLabel.UserInteractionEnabled = true; }
internal void Initialize(ICellsSharedReadOnlyData cellsSharedData) { CellsSharedData = cellsSharedData; LoadView(); if (View != null && View.Superview == null) { ContentView.AddSubview(View); View.TranslatesAutoresizingMaskIntoConstraints = false; View.LeadingAnchor.ConstraintEqualTo(ContentView.LeadingAnchor).SetActive(true); View.TopAnchor.ConstraintEqualTo(ContentView.TopAnchor).SetActive(true); View.TrailingAnchor.ConstraintEqualTo(ContentView.TrailingAnchor).SetActive(true); View.BottomAnchor.ConstraintEqualTo(ContentView.BottomAnchor).SetActive(true); } ViewDidLoad(); }
public FAViewCell(CGRect frame) : base(frame) { _root = new UIView(); _root.TranslatesAutoresizingMaskIntoConstraints = false; _image = new UILabel(); _image.TranslatesAutoresizingMaskIntoConstraints = false; _image.TextAlignment = UITextAlignment.Center; _label = new UILabel(); _label.TranslatesAutoresizingMaskIntoConstraints = false; _label.TextAlignment = UITextAlignment.Center; _root.AddSubview(_image); _root.AddSubview(_label); ContentView.AddSubview(_root); UpdateConstraints(); }
public override void ViewDidAppear(bool animated) { base.ViewDidAppear(animated); if (!Actinmi2) { Menuler = new List <UIButton>(); Menuler.Add(MesajlarButton); Menuler.Add(IsteklerButton); Menuler.Add(FavorilerButton); TasarimiDuzenle(); ButtonTasarimlariniDuzenle(0); GeriButton.ContentEdgeInsets = new UIEdgeInsets(5, 5, 5, 5); AraButton.ContentEdgeInsets = new UIEdgeInsets(5, 5, 5, 5); HeaderView.Hidden = false; var MesajlarNormal1 = MesajlarNormal.Create(this, AraText); MesajlarNormal1.Frame = new CGRect(0, 0, ContentView.Frame.Width, ContentView.Frame.Height); ContentView.AddSubview(MesajlarNormal1); Actinmi2 = true; } }
static void InsertContentView(UIScrollView platformScrollView, IScrollView scrollView, UIView platformContent) { if (scrollView.PresentedContent == null) { return; } var contentContainer = new ContentView() { View = scrollView.PresentedContent, CrossPlatformMeasure = ConstrainToScrollView(scrollView.CrossPlatformMeasure, platformScrollView, scrollView), Tag = ContentPanelTag }; contentContainer.CrossPlatformArrange = ArrangeScrollViewContent(scrollView.CrossPlatformArrange, contentContainer); platformScrollView.ClearSubviews(); contentContainer.AddSubview(platformContent); platformScrollView.AddSubview(contentContainer); }
public void Initialize() { if (!isInitialized) { separatorView = new UIView { TranslatesAutoresizingMaskIntoConstraints = false, BackgroundColor = Constants.Color.White.ColorWithAlpha(0.4f), }; ContentView.AddSubview(separatorView); separatorView.LeftAnchor.ConstraintEqualTo(ContentView.LeftAnchor).Active = true; separatorView.RightAnchor.ConstraintEqualTo(ContentView.RightAnchor).Active = true; separatorView.HeightAnchor.ConstraintEqualTo(0.5f).Active = true; separatorView.CenterYAnchor.ConstraintEqualTo(ContentView.CenterYAnchor).Active = true; isInitialized = true; } }
public CalcCell(System.Drawing.RectangleF frame) : base(frame) { CellHeading = new UILabel(new RectangleF(5, 5, 35, 40)); CellHeading.TextColor = UIColor.DarkTextColor; ContentView.AddSubview(CellHeading); CellContent = new UITextView(new RectangleF(45, 5, 135, 40)); CellContent.ReturnKeyType = UIReturnKeyType.Done; CellContent.Delegate = new CalcTextViewDelegate(x => ActiveCell(x == null? null: this), () => OnRefresh(this)); CellContent.KeyboardType = UIKeyboardType.NumbersAndPunctuation; ContentView.AddSubview(CellContent); CellResult = new UILabel(new RectangleF(180, 5, frame.Width - 180 - 10, 40)); CellResult.TextColor = UIColor.DarkTextColor; CellResult.TextAlignment = UITextAlignment.Right; ContentView.AddSubview(CellResult); }
void setUpViews() { //set image CGRect imageFrame = new CGRect(imageFrameLeftMargin, 0.0, imageFrameWidth, imageFrameWidth); UIImageView cellImageView = new UIImageView(imageFrame); string imageFile = string.Concat("Images/" + primaryText + ".png"); cellImageView.Image = UIImage.FromFile(imageFile); ContentView.AddSubview(cellImageView); //set primary text this.IndentationLevel = 6; this.TextLabel.Text = primaryText; //set secondary text this.DetailTextLabel.Text = secondaryText; this.DetailTextLabel.Lines = 0; this.DetailTextLabel.TextColor = new UIColor(0.458f, 0.458f, 0.458f, 1.0f); }
public NativeListCell(UITableViewCellStyle style, string identifier, CGRect tblFrame) : base(style, identifier) { if (tblFrame != null) { WIDTH = (float)tblFrame.Width; } BackgroundColor = UIColor.Clear; ContentView.Frame = new CGRect(0, 0, WIDTH, HEIGHT); ContentView.BackgroundColor = UIColor.FromRGB(242, 242, 242); UIView SubContainerView = new UIView(ContentView.Frame); SubContainerView.ClipsToBounds = true; SubContainerView.AutoresizingMask = UIViewAutoresizing.All; ContentView.AutoresizingMask = UIViewAutoresizing.All; seperatorLine = new UIView(new CGRect(0, HEIGHT - 1, WIDTH, 1)); seperatorLine.BackgroundColor = UIColor.LightGray; seperatorLine.Alpha = 0.3f; seperatorLine.AutoresizingMask = UIViewAutoresizing.All; lbl_Title = new UILabel(new CGRect(ChildItemLeftPadding, ContentView.Frame.Y, ContentView.Frame.Width, ContentView.Frame.Height)); lbl_Title.TextColor = UIColor.DarkGray; lbl_Title.Font = UIFont.BoldSystemFontOfSize(FontSize); lbl_Title.AutoresizingMask = UIViewAutoresizing.FlexibleWidth; img_RightIcon = new UIImageView(new CGRect( ContentView.Frame.Width - NativeListCell.HEIGHT - 20, 0, NativeListCell.HEIGHT, NativeListCell.HEIGHT )); img_RightIcon.ContentMode = UIViewContentMode.Center; img_RightIcon.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin; SubContainerView.AddSubview(lbl_Title); SubContainerView.AddSubview(seperatorLine); SubContainerView.AddSubview(img_RightIcon); ContentView.AddSubview(SubContainerView); }
public MyCollectionViewCell(CGRect frame) : base(frame) { BackgroundView = new UIView { BackgroundColor = UIColor.Orange }; SelectedBackgroundView = new UIView { BackgroundColor = UIColor.Green }; ContentView.Layer.BorderColor = UIColor.LightGray.CGColor; ContentView.Layer.BorderWidth = 2.0f; ContentView.BackgroundColor = UIColor.White; ContentView.Transform = CGAffineTransform.MakeScale(0.8f, 0.8f); imageView = new UIImageView(UIImage.FromBundle("icon.png")); imageView.Center = ContentView.Center; imageView.Transform = CGAffineTransform.MakeScale(0.2f, 0.2f); ContentView.AddSubview(imageView); }
public Cell(RectangleF frame) : base(frame) { label = new UILabel(new RectangleF(PointF.Empty, frame.Size)) { AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth, TextAlignment = UITextAlignment.Center, Font = UIFont.BoldSystemFontOfSize(50.0f), BackgroundColor = UIColor.ScrollViewTexturedBackgroundColor, }; UIImageView imageView = new UIImageView(new UIImage("Images/rupert.png")) { Frame = label.Frame }; label.Add(imageView); ContentView.AddSubview(label); ContentView.Layer.BorderWidth = 1.0f; ContentView.Layer.BorderColor = UIColor.White.CGColor; }
public AnimalCell(System.Drawing.RectangleF frame) : base(frame) { BackgroundView = new UIView { BackgroundColor = UIColor.Orange }; SelectedBackgroundView = new UIView { BackgroundColor = UIColor.Green }; ContentView.Layer.BorderColor = UIColor.LightGray.CGColor; ContentView.Layer.BorderWidth = 2.0f; ContentView.BackgroundColor = UIColor.White; ContentView.Transform = CGAffineTransform.MakeScale(0.8f, 0.8f); imageView = new UIImageView(UIImage.FromBundle("placeholder.png")); imageView.Center = ContentView.Center; imageView.Transform = CGAffineTransform.MakeScale(0.7f, 0.7f); ContentView.AddSubview(imageView); }