private void SetUpSwitchRow() { var switchRow = new SwitchRowView(); switchRow.Text = "Show and hide rows with animation"; switchRow.SwitchChanged += (sender, isOn) => { StackView.SetRowsHidden(hiddenRows, isHidden: !isOn, animated: true); }; StackView.AddRow(switchRow); }
private void SetUpDescriptionRow() { var label = new UILabel { Font = UIFont.PreferredBody, Lines = 0, Text = "This simple app shows some ways you can use AloeStackView to lay out a screen in your app." }; StackView.AddRow(label); }
private void SetUpPhotoRow() { var titleLabel = new UILabel(); titleLabel.Font = UIFont.PreferredBody; titleLabel.Lines = 0; titleLabel.Text = "Handle user interaction"; StackView.AddRow(titleLabel); StackView.HideSeparator(titleLabel); StackView.SetInset(forRow: titleLabel, inset: new UIEdgeInsets( top: StackView.RowInset.Top, left: StackView.RowInset.Left, bottom: 4, right: StackView.RowInset.Right)); var captionLabel = new UILabel(); captionLabel.Font = UIFont.PreferredCaption2; captionLabel.TextColor = UIColor.Blue; captionLabel.Lines = 0; captionLabel.Text = "(Try tapping on the photo!)"; StackView.AddRow(captionLabel); StackView.HideSeparator(forRow: captionLabel); StackView.SetInset(forRow: captionLabel, inset: new UIEdgeInsets( top: 0, left: StackView.RowInset.Left, bottom: StackView.RowInset.Bottom, right: StackView.RowInset.Right)); var image = new UIImage(); // TODO: add image var aspectRatio = 1; //image.Size.Height / image.Size.Width; var imageView = new UIImageView(new CGRect(0, 0, 100, 100)); // image: image imageView.BackgroundColor = UIColor.Red; imageView.UserInteractionEnabled = true; imageView.ContentMode = UIViewContentMode.ScaleAspectFit; imageView.HeightAnchor.ConstraintEqualTo(imageView.WidthAnchor, multiplier: aspectRatio).Active = true; StackView.AddRow(imageView); StackView.SetTapHandler(imageView, _ => { var alert = UIAlertController.Create("Title ;)", "Tapped", UIAlertControllerStyle.Alert); alert.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Cancel, null)); PresentViewController(alert, true, null); // TODO: create photo view controller //var vc = new PhotoViewController(); //NavigationController.PushViewController(vc, animated: true); }); }
private void SetUpExpandingRowView() { var expandingRow = new ExpandingRowView(); StackView.AddRow(expandingRow); }