public CustomPopUpView(string message, string buttonText, CGSize size) { UIImageView img = null; this.Layer.CornerRadius = _cornerRadius; this.Layer.MasksToBounds = true; _effectView.Alpha = 0; this.BackgroundColor = UIColor.White; img = new UIImageView(UIImage.FromBundle("UploadDocumentIcon.png")); img.Frame = new CoreGraphics.CGRect(10, 40, img.Image.CGImage.Width / 2, img.Image.CGImage.Height / 2); var messageBody = string.IsNullOrEmpty(message + "\n") ? "Error" : message + "\n"; var messageLabel = new UILabel() { BackgroundColor = UIColor.Clear, TextColor = UIColor.Black, Text = messageBody, TextAlignment = UITextAlignment.Left, AutoresizingMask = UIViewAutoresizing.All, LineBreakMode = UILineBreakMode.WordWrap, Lines = 0 }; var messageLabelSize = messageLabel.Text.StringSize(messageLabel.Font, new SizeF((float)size.Width, 500)); var messageLabelHeight = messageLabelSize.Height + 20; messageLabel.Frame = new CGRect((img.Image.CGImage.Width / 2) + 20, 30, 220, messageLabelHeight); var additionalFrameHeight = (messageLabelHeight - size.Height) < 0 ? 90 + (messageLabelHeight - size.Height) : (messageLabelHeight - size.Height) + 90; nfloat lx = (UIScreen.MainScreen.Bounds.Width - size.Width) / 2; nfloat ly = (UIScreen.MainScreen.Bounds.Height - (size.Height + additionalFrameHeight)) / 2; this.Frame = new CGRect(new CGPoint(lx, ly), new CGSize(size.Width, size.Height + additionalFrameHeight)); var stack = new UIStackView() { Alignment = UIStackViewAlignment.Center }; stack.Frame = new CGRect(0, 0, this.Frame.Width, this.Frame.Height); _actionBtn.SetTitle(buttonText, UIControlState.Normal); _actionBtn.Frame = new CGRect(0, this.Frame.Height - _btnHeight, this.Frame.Width, _btnHeight); _actionBtn.BackgroundColor = UIColor.FromRGB(4, 103, 161); _actionBtn.SetTitleColor(UIColor.White, UIControlState.Normal); _actionBtn.TouchUpInside += delegate { YesButtonClicked?.Invoke(); Close(); }; stack.AddSubview(messageLabel); stack.AddSubview(img); stack.AddSubview(_actionBtn); this.AddSubview(stack); }
private void InitializingContextMenuLayout() { //contextMenu UIView contextMenu = new UIView(); contextMenu.BackgroundColor = UIColor.White; contextMenu.Frame = new CGRect(0, 0, 200, 200); //contextMenuView with horizontal alignment to hold the imageColum & buttonColumn UIStackView contextMenuView = new UIStackView { Axis = UILayoutConstraintAxis.Horizontal }; contextMenuView.Frame = new CGRect(0, 0, 200, 200); //initializing & Framing this.imageColumn = new UIView(); this.imageColumn.Frame = new CGRect(10, 0, 50, 200); this.buttonColumn = new UIView(); this.buttonColumn.Frame = new CGRect(imageColumn.Frame.Width, 0, 150, 200); //Method to creating Image's and Button CreateImages(contextMenuImageNames); CreateButtons(contextMenuButtonNames); contextMenuView.AddSubview(this.imageColumn); contextMenuView.AddSubview(this.buttonColumn); contextMenu.AddSubview(contextMenuView); this.sfPopup.PopupView.ContentView = contextMenu; }
public CustomPopUpView(string message, string yesButtonText, string noButtonText, CGSize size) { nfloat lx = (UIScreen.MainScreen.Bounds.Width - size.Width) / 2; nfloat ly = (UIScreen.MainScreen.Bounds.Height - size.Height) / 2; this.Frame = new CGRect(new CGPoint(lx, ly), size); this.Layer.CornerRadius = CornerRadius; this.Layer.MasksToBounds = true; _effectView.Alpha = 0; this.BackgroundColor = UIColor.White; var messageBody = string.IsNullOrEmpty(message + "\n") ? "Error" : message + "\n"; var label = new UILabel { BackgroundColor = UIColor.Clear, TextColor = UIColor.Black, Text = messageBody, TextAlignment = UITextAlignment.Left, AutoresizingMask = UIViewAutoresizing.All, LineBreakMode = UILineBreakMode.WordWrap, Lines = 0 }; var labelSize = label.Text.StringSize(label.Font, new SizeF((float)this.Frame.Width, 500)); var labelHeight = labelSize.Height + 25; label.Frame = new CGRect(this.Frame.Width, labelHeight > 25 ? 30 : 50, 200, labelHeight); var stack = new UIStackView { Alignment = UIStackViewAlignment.Center, Frame = new CGRect(0, 0, this.Frame.Width, this.Frame.Height) }; _btnClose.SetTitle(noButtonText, UIControlState.Normal); _btnClose.Frame = new CGRect(this.Frame.Width / 2, this.Frame.Height - _btnHeight, this.Frame.Width / 2, _btnHeight); _btnClose.BackgroundColor = UIColor.FromRGB(245, 245, 245); _btnClose.SetTitleColor(UIColor.Black, UIControlState.Normal); _btnClose.TouchUpInside += delegate { NoButtonClicked?.Invoke(); Close(); }; _actionBtn.SetTitle(yesButtonText, UIControlState.Normal); _actionBtn.Frame = new CGRect(0, this.Frame.Height - _btnHeight, this.Frame.Width / 2, _btnHeight); _actionBtn.BackgroundColor = UIColor.FromRGB(245, 16, 16); _actionBtn.SetTitleColor(UIColor.White, UIControlState.Normal); _actionBtn.TouchUpInside += delegate { YesButtonClicked?.Invoke(); Close(); }; stack.AddSubview(label); stack.AddSubview(_btnClose); stack.AddSubview(_actionBtn); this.AddSubview(stack); }
private void CreatePreferencesView() { _preferencesView = new UIStackView(new CoreGraphics.CGRect(View.Frame.Width / 3, Constants.NavBarHeight, View.Frame.Width / 3 * 2, View.Frame.Height)); _gallerySubheading = new UITextView { Text = Constants.GallerySubheading, TextColor = Constants.SettingsSubheadingTextColour, Editable = false, BackgroundColor = Constants.TableBackgroundColour, TranslatesAutoresizingMaskIntoConstraints = false, AdjustsFontForContentSizeCategory = true, UserInteractionEnabled = false, ScrollEnabled = false, Font = UIFont.GetPreferredFontForTextStyle(UIFontTextStyle.Subheadline) }; _confidenceSubheading = new UITextView { Text = Constants.ConfidenceSubheading, TextColor = Constants.SettingsSubheadingTextColour, Editable = false, BackgroundColor = Constants.TableBackgroundColour, TranslatesAutoresizingMaskIntoConstraints = false, AdjustsFontForContentSizeCategory = true, UserInteractionEnabled = false, ScrollEnabled = false, Font = UIFont.GetPreferredFontForTextStyle(UIFontTextStyle.Subheadline) }; _confidenceNote = new UITextView { Text = Constants.ConfidenceNote, TextColor = Constants.SettingsSubheadingTextColour, Editable = false, BackgroundColor = Constants.TableBackgroundColour, TranslatesAutoresizingMaskIntoConstraints = false, AdjustsFontForContentSizeCategory = true, UserInteractionEnabled = false, ScrollEnabled = false, Font = UIFont.GetPreferredFontForTextStyle(UIFontTextStyle.Footnote) }; _galleryCell = CreateGalleryCell(); _confidenceCell = CreateConfidenceCell(); _preferencesView.AddSubview(_gallerySubheading); _preferencesView.AddSubview(_galleryCell); _preferencesView.AddSubview(_confidenceSubheading); _preferencesView.AddSubview(_confidenceCell); _preferencesView.AddSubview(_confidenceNote); ConstrainItems(); _preferencesView.Hidden = true; View.AddSubview(_preferencesView); _settingViews.Add(_preferencesView); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. UIStackView stack = new UIStackView(); dataForm = new SfDataForm(); dataForm.DataObject = new DataFormModel(); dataForm.Frame = new CGRect(0, 100, 400, 1000); UIButton button = new UIButton(); button.SetTitle("Submit", UIControlState.Normal); button.TouchUpInside += Button_TouchUpInside; button.Frame = new CGRect(0, 40, 400, 50); button.BackgroundColor = UIColor.Gray; stack.AddSubview(button); stack.AddSubview(dataForm); this.View.AddSubview(button); this.View.AddSubview(dataForm); }
void UpdateSwipeItems() { if (_contentView == null || Element?.Handler?.MauiContext == null) { return; } ISwipeItems?items = Element.GetSwipeItemsByDirection(_swipeDirection); if (items == null || items.Count == 0) { return; } _swipeItemsRect = new List <CGRect>(); double swipeItemsWidth; if (_swipeDirection == SwipeDirection.Left || _swipeDirection == SwipeDirection.Right) { swipeItemsWidth = items.Count * SwipeViewExtensions.SwipeItemWidth; } else { swipeItemsWidth = _contentView.Frame.Width; } _actionView = new UIStackView { Axis = UILayoutConstraintAxis.Horizontal, Frame = new CGRect(0, 0, swipeItemsWidth, _contentView.Frame.Height) }; foreach (var item in items) { UIView swipeItem = item.ToPlatform(Element.Handler.MauiContext); _actionView.AddSubview(swipeItem); _swipeItems.Add(item, swipeItem); } AddSubview(_actionView); BringSubviewToFront(_contentView); LayoutSwipeItems(GetNativeSwipeItems()); }
private void Initialize() { BackgroundColor = UIColor.Clear; // At run-time, don't display the sub-views until their dimensions have been calculated if (!DesignTime.IsDesignMode) { Hidden = true; } _rootStackView = new UIStackView() { Axis = UILayoutConstraintAxis.Vertical, Alignment = UIStackViewAlignment.Leading, Distribution = UIStackViewDistribution.Fill, TranslatesAutoresizingMaskIntoConstraints = false, Spacing = 0 }; _listView = new UITableView(UIScreen.MainScreen.Bounds) { ClipsToBounds = true, ContentMode = UIViewContentMode.ScaleAspectFill, SeparatorStyle = UITableViewCellSeparatorStyle.None, AllowsSelection = false, Bounces = true, TranslatesAutoresizingMaskIntoConstraints = false, AutoresizingMask = UIViewAutoresizing.All, RowHeight = UITableView.AutomaticDimension, EstimatedRowHeight = 100, }; _listView.RegisterClassForCellReuse(typeof(LegendItemCell), LegendTableSource.CellId); _rootStackView.AddSubview(_listView); AddSubview(_rootStackView); _listView.LeadingAnchor.ConstraintEqualTo(LeadingAnchor).Active = true; _listView.TopAnchor.ConstraintEqualTo(TopAnchor).Active = true; _listView.TrailingAnchor.ConstraintEqualTo(TrailingAnchor).Active = true; _listView.HeightAnchor.ConstraintEqualTo(HeightAnchor).Active = true; InvalidateIntrinsicContentSize(); }
void UpdateSwipeItems() { if (_contentView == null || _actionView != null) { return; } _swipeItemsRect = new List <CGRect>(); SwipeItems items = GetSwipeItemsByDirection(); double swipeItemsWidth; if (_swipeDirection == SwipeDirection.Left || _swipeDirection == SwipeDirection.Right) { swipeItemsWidth = (items != null ? items.Count : 0) * SwipeItemWidth; } else { swipeItemsWidth = _contentView.Frame.Width; } if (items == null) { return; } _actionView = new UIStackView { Axis = UILayoutConstraintAxis.Horizontal, Frame = new CGRect(0, 0, swipeItemsWidth, _contentView.Frame.Height) }; int i = 0; float previousWidth = 0; foreach (var item in items) { var swipeItem = (item is SwipeItem) ? CreateSwipeItem((SwipeItem)item) : CreateSwipeItemView((SwipeItemView)item); var swipeItemSize = GetSwipeItemSize(item); float swipeItemHeight = (float)swipeItemSize.Height; float swipeItemWidth = (float)swipeItemSize.Width; switch (_swipeDirection) { case SwipeDirection.Left: swipeItem.Frame = new CGRect(_contentView.Frame.Width - (swipeItemWidth + previousWidth), 0, i + 1 * swipeItemWidth, swipeItemHeight); break; case SwipeDirection.Right: case SwipeDirection.Up: case SwipeDirection.Down: swipeItem.Frame = new CGRect(previousWidth, 0, i + 1 * swipeItemWidth, swipeItemHeight); break; } _actionView.AddSubview(swipeItem); _swipeItemsRect.Add(swipeItem.Frame); previousWidth += swipeItemWidth; i++; } AddSubview(_actionView); BringSubviewToFront(_contentView); }
public RadioButton_Mobile() { View = new UIView(); //Main statck layer.BorderWidth = 1.5f; layer.CornerRadius = 10; layer.BorderColor = UIColor.FromRGB(205, 205, 205).CGColor; Layer.AddSublayer(layer); //inner layer innerLayer.BorderWidth = 1.5f; innerLayer.CornerRadius = 10; innerLayer.BorderColor = UIColor.FromRGB(205, 205, 205).CGColor; mainStackView.Layer.AddSublayer(innerLayer); descriptor = new UIFontDescriptor().CreateWithFamily(amntLabl.Font.FamilyName); traits = traits | UIFontDescriptorSymbolicTraits.Bold; descriptor = descriptor.CreateWithTraits(traits); //heading hedinglbl.Text = "Complete your Payment"; hedinglbl.TextColor = UIColor.FromRGB(85, 85, 85); hedinglbl.Font = UIFont.FromDescriptor(descriptor, 20); mainStackView.AddSubview(hedinglbl); //payable payamountlabl.Text = "Total payable amount"; payamountlabl.TextColor = UIColor.Black; mainStackView.AddSubview(payamountlabl); //amount amntLabl.Text = "$120"; amntLabl.TextColor = UIColor.FromRGB(0, 125, 230); amntLabl.Font = UIFont.FromDescriptor(descriptor, 18); mainStackView.AddSubview(amntLabl); //amount selcetPaylbl.Text = "Select your payment mode"; mainStackView.AddSubview(selcetPaylbl); //RadioGroup sfr.Axis = UILayoutConstraintAxis.Vertical; sfr.Spacing = 20; netBanking.SetTitle("Net banking", UIControlState.Normal); netBanking.StateChanged += paymentMode_StateChanged; sfr.AddArrangedSubview(netBanking); debitCard.SetTitle("Debit card", UIControlState.Normal); debitCard.StateChanged += paymentMode_StateChanged; sfr.AddArrangedSubview(debitCard); creditCard.SetTitle("Credit card", UIControlState.Normal); creditCard.StateChanged += paymentMode_StateChanged; sfr.AddArrangedSubview(creditCard); mainStackView.AddSubview(sfr); View.AddSubview(mainStackView); button.SetTitle("Pay Now", UIControlState.Normal); button.SetTitleColor(UIColor.LightGray, UIControlState.Disabled); button.SetTitleColor(UIColor.White, UIControlState.Normal); button.TouchDown += Button_Clicked; button.BackgroundColor = UIColor.FromRGB(0, 125, 230); button.Enabled = false; alertView.Message = "Payment Successfull !"; alertView.AddButton("OK"); View.AddSubview(button); AddSubview(View); }
private void CreateView() { _commentTextView = new UITextView(); _commentTextView.Layer.BorderColor = Helpers.Constants.R244G244B246.CGColor; _commentTextView.Layer.BorderWidth = 1f; _commentTextView.Layer.CornerRadius = 20f; _commentTextView.TextContainerInset = new UIEdgeInsets(10, 20, 10, 15); _commentTextView.Font = Constants.Regular14; _commentTextView.Bounces = false; _commentTextView.ShowsVerticalScrollIndicator = false; _commentsTextViewDelegate = new CommentsTextViewDelegate(); _commentsTextViewDelegate.ChangedAction += (gh) => { _commentViewHeight.Constant = _commentTextViewHeight.Constant = gh; if (_postToEdit != null && _postToEdit.Editing) { _saveButton.Enabled = _postToEdit.Body != _commentTextView.Text; } }; _commentTextView.Delegate = _commentsTextViewDelegate; _sendButton = new UIButton(); _sendButton.Layer.BorderColor = Constants.R244G244B246.CGColor; _sendButton.Layer.BorderWidth = 1f; _sendButton.Layer.CornerRadius = 20f; _sendButton.SetImage(UIImage.FromBundle("ic_send_comment"), UIControlState.Normal); _sendButton.TouchDown += CreateComment; _sendProgressBar = new UIActivityIndicatorView(); _sendProgressBar.Color = Constants.R231G72B0; _sendProgressBar.HidesWhenStopped = true; _commentView = new UIStackView(new UIView[] { _commentTextView, _sendButton, _sendProgressBar }); _commentView.Alignment = UIStackViewAlignment.Center; _commentView.Spacing = 10; _sendProgressBar.AutoSetDimension(ALDimension.Width, 40); _sendProgressBar.AutoSetDimension(ALDimension.Height, 40); var backgroundView = new UIView(); backgroundView.TranslatesAutoresizingMaskIntoConstraints = false; _commentView.InsertSubview(backgroundView, 0); backgroundView.AutoPinEdgesToSuperviewEdges(); _sendButton.AutoSetDimension(ALDimension.Width, 40); _sendButton.AutoSetDimension(ALDimension.Height, 40); _commentsTable = new UITableView(); _rootView = new UIStackView(new UIView[] { _commentsTable, _commentView }); _rootView.Axis = UILayoutConstraintAxis.Vertical; View.AddSubview(_rootView); _rootView.AutoPinEdgeToSuperviewEdge(ALEdge.Top); if (DeviceModel.Model(DeviceHardware.HardwareModel) == "iPhone10,6") { _rootView.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom, 34); } else { _rootView.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom); } _rootView.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _rootView.AutoPinEdgeToSuperviewEdge(ALEdge.Right); _commentTextViewHeight = _commentTextView.AutoSetDimension(ALDimension.Height, 40, NSLayoutRelation.GreaterThanOrEqual); _commentViewHeight = _commentView.AutoSetDimension(ALDimension.Height, 40, NSLayoutRelation.GreaterThanOrEqual); _commentView.LayoutMargins = new UIEdgeInsets(10, 15, 10, 15); _commentView.LayoutMarginsRelativeArrangement = true; _saveButton = new UIButton(); _saveButton.SetTitle("Save", UIControlState.Normal); _saveButton.SetTitleColor(UIColor.FromRGB(255, 44, 5), UIControlState.Normal); _saveButton.TouchDown += SaveTap; _saveButton.Layer.BorderColor = Constants.R244G244B246.CGColor; _saveButton.Layer.BorderWidth = 1f; _saveButton.Layer.CornerRadius = 20f; _saveButton.Font = Constants.Semibold14; _editProgressBar = new UIActivityIndicatorView(); _editProgressBar.Color = Constants.R231G72B0; _editProgressBar.HidesWhenStopped = true; _cancelButton = new UIButton(); _cancelButton.SetTitle("Cancel", UIControlState.Normal); _cancelButton.SetTitleColor(UIColor.Black, UIControlState.Normal); _cancelButton.TouchDown += CancelTap; _cancelButton.Layer.BorderColor = Constants.R244G244B246.CGColor; _cancelButton.Layer.BorderWidth = 1f; _cancelButton.Layer.CornerRadius = 20f; _cancelButton.Font = Constants.Regular14; _buttonsContainer = new UIStackView(new UIView[] { _cancelButton, _saveButton, _editProgressBar }); _buttonsContainer.AutoSetDimension(ALDimension.Height, 50); _buttonsContainer.Spacing = 15; _buttonsContainer.Distribution = UIStackViewDistribution.FillEqually; _buttonsContainer.LayoutMargins = new UIEdgeInsets(0, 15, 10, 15); _buttonsContainer.LayoutMarginsRelativeArrangement = true; _buttonsContainer.Hidden = true; _rootView.AddArrangedSubview(_buttonsContainer); _tableProgressBar = new UIActivityIndicatorView(); _tableProgressBar.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge; _tableProgressBar.Color = Constants.R231G72B0; _tableProgressBar.HidesWhenStopped = true; _rootView.AddSubview(_tableProgressBar); _tableProgressBar.AutoAlignAxis(ALAxis.Horizontal, _commentsTable); _tableProgressBar.AutoAlignAxis(ALAxis.Vertical, _commentsTable); }
public CheckBox_Mobile() { //Image image.Image = UIImage.FromBundle("Images/Pizzaimage.png"); AddSubview(image); //Main statck mainStackView.Axis = UILayoutConstraintAxis.Vertical; //Layer layer.BorderWidth = 1.5f; layer.BorderColor = UIColor.FromRGB(205, 205, 205).CGColor; layer.CornerRadius = 10; Layer.AddSublayer(layer); //heading hedinglbl.Text = "Add Extra Toppings"; hedinglbl.TextColor = UIColor.FromRGB(0, 125, 230); hedinglbl.Font = UIFont.FromName(hedinglbl.Font.FamilyName, 20); mainStackView.AddSubview(hedinglbl); //Select All selectAll.SetTitle("Select All", UIControlState.Normal); selectAll.SetTitleColor(UIColor.Black, UIControlState.Normal); selectAll.StateChanged += SelectAll_StateChanged; mainStackView.AddSubview(selectAll); //GrilledChicken grilledChicken.SetTitle("Grilled Chicken", UIControlState.Normal); grilledChicken.SetTitleColor(UIColor.Black, UIControlState.Normal); grilledChicken.StateChanged += Toppings_StateChanged; mainStackView.AddSubview(grilledChicken); //ChickenTikka chickenTikka.SetTitle("Chicken Tikka", UIControlState.Normal); chickenTikka.SetTitleColor(UIColor.Black, UIControlState.Normal); chickenTikka.StateChanged += Toppings_StateChanged; mainStackView.AddSubview(chickenTikka); //ChickenSausage chickenSausage.SetTitle("Chicken Sausage", UIControlState.Normal); chickenSausage.SetTitleColor(UIColor.Black, UIControlState.Normal); chickenSausage.StateChanged += Toppings_StateChanged; mainStackView.AddSubview(chickenSausage); //Beef beef.SetTitle("Beef", UIControlState.Normal); beef.SetTitleColor(UIColor.Black, UIControlState.Normal); beef.StateChanged += Toppings_StateChanged; mainStackView.AddSubview(beef); //Button button.SetTitle("Order Now", UIControlState.Normal); button.SetTitleColor(UIColor.LightGray, UIControlState.Disabled); button.SetTitleColor(UIColor.White, UIControlState.Normal); button.BackgroundColor = UIColor.FromRGB(0, 125, 230); button.TouchDown += Button_Clicked; button.Enabled = false; AddSubview(button); //Alert alertView.Message = "Your order has been placed successfully !"; alertView.AddButton("OK"); AddSubview(mainStackView); }
public CustomPopUpView(string message, string buttonText, CGSize size, bool isWarning = false) { nfloat lx = (UIScreen.MainScreen.Bounds.Width - size.Width) / 2; nfloat ly = (UIScreen.MainScreen.Bounds.Height - size.Height) / 2; UIImageView img = null; this.Frame = new CGRect(new CGPoint(lx, ly), size); this.Layer.MasksToBounds = true; _effectView.Alpha = 0; this.BackgroundColor = UIColor.White; if (isWarning) { img = new UIImageView(UIImage.FromBundle("InfoIcon.png")); } else { img = new UIImageView(UIImage.FromBundle("OkIcon.png")); } img.Frame = new CoreGraphics.CGRect(10, 40, img.Image.CGImage.Width / 2, img.Image.CGImage.Height / 2); string messageBody; if (message.ToCharArray().Length < 28) { messageBody = string.IsNullOrEmpty(message) ? "Error" : message; } else { messageBody = string.IsNullOrEmpty(message + "\n") ? "Error" : message + "\n"; } var label = new UILabel() { BackgroundColor = UIColor.Clear, TextColor = UIColor.Black, Text = messageBody, TextAlignment = UITextAlignment.Left, AutoresizingMask = UIViewAutoresizing.All, LineBreakMode = UILineBreakMode.WordWrap, Lines = 0 }; var labelSize = label.Text.StringSize(label.Font, new SizeF((float)this.Frame.Width, 500)); label.Frame = new CGRect((img.Image.CGImage.Width / 2) + 20, labelSize.Height > 40 ? 35 : 50, 200, labelSize.Height); var stack = new UIStackView() { Alignment = UIStackViewAlignment.Center }; stack.Frame = new CGRect(0, 0, this.Frame.Width, this.Frame.Height); _actionBtn.SetTitle(buttonText, UIControlState.Normal); _actionBtn.Frame = new CGRect(0, this.Frame.Height - _btnHeight, this.Frame.Width, _btnHeight); _actionBtn.BackgroundColor = UIColor.FromRGB(4, 103, 161); _actionBtn.SetTitleColor(UIColor.White, UIControlState.Normal); _actionBtn.TouchUpInside += delegate { YesButtonClicked?.Invoke(); Close(); }; stack.AddSubview(label); stack.AddSubview(img); stack.AddSubview(_actionBtn); this.AddSubview(stack); }
public void AddNotify(int areaID) { UIStackView stackView = View.ViewWithTag(1) as UIStackView; UIStackView Container = new UIStackView(); Container.Axis = UILayoutConstraintAxis.Horizontal; Container.BackgroundColor = UIColor.Red; Container.Distribution = UIStackViewDistribution.FillEqually; Container.HeightAnchor.ConstraintEqualTo((float)(SCREEN_HEIGHT / 9)).Active = true; Container.WidthAnchor.ConstraintEqualTo((float)(SCREEN_WIDTH - 20)).Active = true; Container.Tag = (areaID * 10) + 0; Container.Hidden = true; UIView BG = new UIView(); BG.BackgroundColor = UIColor.FromRGBA(255, 0, 0, 150); BG.Frame = Container.Bounds; BG.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions; BG.Tag = (areaID * 10) + 5; UIStackView Left = new UIStackView(); Left.Axis = UILayoutConstraintAxis.Vertical; Left.Distribution = UIStackViewDistribution.FillEqually; UIStackView Center = new UIStackView(); Center.Axis = UILayoutConstraintAxis.Vertical; Center.Distribution = UIStackViewDistribution.FillEqually; UIStackView Right = new UIStackView(); Right.Axis = UILayoutConstraintAxis.Vertical; Right.Distribution = UIStackViewDistribution.FillEqually; UILabel TopLeft = new UILabel(); TopLeft.Text = "Çıkış Adı"; TopLeft.TextAlignment = UITextAlignment.Center; TopLeft.TextColor = UIColor.White; UILabel BottomLeft = new UILabel(); BottomLeft.Text = "BottomLeft"; BottomLeft.TextAlignment = UITextAlignment.Center; BottomLeft.TextColor = UIColor.White; BottomLeft.Tag = (areaID * 10) + 1; UILabel TopCenter = new UILabel(); TopCenter.Text = "Güvenli Çıkış"; TopCenter.TextAlignment = UITextAlignment.Center; TopCenter.TextColor = UIColor.White; UIWebView Page = new UIWebView(); UILabel BottomCenter = new UILabel(); BottomCenter.Text = "TopRight"; BottomCenter.TextAlignment = UITextAlignment.Center; BottomCenter.TextColor = UIColor.White; BottomCenter.Tag = (areaID * 10) + 2; UILabel TopRight = new UILabel(); TopRight.Text = "Kalan Süre"; TopRight.TextAlignment = UITextAlignment.Center; TopRight.TextColor = UIColor.White; TopRight.Tag = (areaID * 10) + 4; UILabel BottomRight = new UILabel(); BottomRight.Text = "BottomRight"; BottomRight.TextAlignment = UITextAlignment.Center; BottomRight.TextColor = UIColor.White; BottomRight.Tag = (areaID * 10) + 3; Left.AddArrangedSubview(TopLeft); Left.AddArrangedSubview(BottomLeft); Center.AddArrangedSubview(TopCenter); Center.AddArrangedSubview(BottomCenter); Right.AddArrangedSubview(TopRight); Right.AddArrangedSubview(BottomRight); Container.AddSubview(BG); Container.AddArrangedSubview(Left); Container.AddArrangedSubview(Center); Container.AddArrangedSubview(Right); stackView.AddArrangedSubview(Container); stackView.CenterXAnchor.ConstraintEqualTo(View.CenterXAnchor).Active = true; stackView.TopAnchor.ConstraintEqualTo(View.TopAnchor, 20).Active = true; NotificationList.Add(new ExitNotificationIOS { areaID = areaID, RightID = Convert.ToInt32(BottomRight.Tag), CenterID = Convert.ToInt32(BottomCenter.Tag), LeftID = Convert.ToInt32(BottomLeft.Tag), ContainerID = Convert.ToInt32(Container.Tag), RightUpperID = Convert.ToInt32(TopRight.Tag), BGID = Convert.ToInt32(BG.Tag) }); }