private void CreateView() { GetPostSize(); SetImage(); var photoTitleSeparator = new UIView(); photoTitleSeparator.BackgroundColor = Constants.R245G245B245; titleTextField = new UITextView(); titleTextField.ScrollEnabled = false; titleTextField.Font = Constants.Semibold14; titleEditImage = new UIImageView(); titleEditImage.Image = UIImage.FromBundle("ic_edit"); var titleDescriptionSeparator = new UIView(); titleDescriptionSeparator.BackgroundColor = Constants.R245G245B245; descriptionTextField = new UITextView(); descriptionTextField.ScrollEnabled = false; descriptionTextField.Font = Constants.Regular14; descriptionEditImage = new UIImageView(); descriptionEditImage.Image = UIImage.FromBundle("ic_edit"); var descriptionHashtagSeparator = new UIView(); descriptionHashtagSeparator.BackgroundColor = Constants.R245G245B245; tagField = new UILabel(); tagField.Text = "Hashtag"; tagField.Font = Constants.Regular14; tagField.TextColor = Constants.R151G155B158; tagField.UserInteractionEnabled = true; var tap = new UITapGestureRecognizer(OpenTagPicker); tagField.AddGestureRecognizer(tap); hashtagImage = new UIImageView(); hashtagImage.Image = UIImage.FromBundle("ic_hash"); var hashtagCollectionSeparator = new UIView(); hashtagCollectionSeparator.BackgroundColor = Constants.R245G245B245; postPhotoButton = new UIButton(); postPhotoButton.SetTitle(AppSettings.LocalizationManager.GetText(LocalizationKeys.PublishButtonText), UIControlState.Normal); postPhotoButton.SetTitle("", UIControlState.Disabled); postPhotoButton.Layer.CornerRadius = 25; postPhotoButton.TitleLabel.Font = Constants.Semibold14; postPhotoButton.TouchDown += PostPhoto; loadingView = new UIActivityIndicatorView(); loadingView.Color = UIColor.White; loadingView.HidesWhenStopped = true; mainScroll.Bounces = false; mainScroll.AddSubview(photoTitleSeparator); mainScroll.AddSubview(titleTextField); mainScroll.AddSubview(titleEditImage); mainScroll.AddSubview(titleDescriptionSeparator); mainScroll.AddSubview(descriptionTextField); mainScroll.AddSubview(descriptionEditImage); mainScroll.AddSubview(descriptionHashtagSeparator); mainScroll.AddSubview(tagField); mainScroll.AddSubview(hashtagImage); mainScroll.AddSubview(hashtagCollectionSeparator); mainScroll.AddSubview(tagsCollectionView); mainScroll.AddSubview(postPhotoButton); mainScroll.AddSubview(loadingView); if (photoView != null) { photoTitleSeparator.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, photoView, 15f); } else { photoTitleSeparator.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, photoCollection, 15f); } photoTitleSeparator.AutoPinEdgeToSuperviewEdge(ALEdge.Left, _separatorMargin); photoTitleSeparator.AutoPinEdgeToSuperviewEdge(ALEdge.Right, _separatorMargin); photoTitleSeparator.AutoSetDimension(ALDimension.Height, 1f); photoTitleSeparator.AutoSetDimension(ALDimension.Width, UIScreen.MainScreen.Bounds.Width - _separatorMargin * 2); titleTextField.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, photoTitleSeparator, 17f); titleTextField.AutoPinEdge(ALEdge.Left, ALEdge.Left, photoTitleSeparator, -5f); titleEditImage.AutoSetDimensionsToSize(new CGSize(18, 18)); titleEditImage.AutoPinEdge(ALEdge.Right, ALEdge.Right, photoTitleSeparator); titleEditImage.AutoPinEdge(ALEdge.Left, ALEdge.Right, titleTextField, 5f); titleEditImage.AutoAlignAxis(ALAxis.Horizontal, titleTextField); titleDescriptionSeparator.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, titleTextField, 17f); titleDescriptionSeparator.AutoPinEdge(ALEdge.Left, ALEdge.Left, photoTitleSeparator); titleDescriptionSeparator.AutoPinEdge(ALEdge.Right, ALEdge.Right, photoTitleSeparator); titleDescriptionSeparator.AutoSetDimension(ALDimension.Height, 1f); descriptionTextField.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, titleDescriptionSeparator, 17f); descriptionTextField.AutoPinEdge(ALEdge.Left, ALEdge.Left, photoTitleSeparator, -5f); descriptionEditImage.AutoSetDimensionsToSize(new CGSize(18, 18)); descriptionEditImage.AutoPinEdge(ALEdge.Right, ALEdge.Right, photoTitleSeparator); descriptionEditImage.AutoPinEdge(ALEdge.Left, ALEdge.Right, descriptionTextField, 5f); descriptionEditImage.AutoAlignAxis(ALAxis.Horizontal, descriptionTextField); descriptionHashtagSeparator.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, descriptionTextField, 17f); descriptionHashtagSeparator.AutoPinEdge(ALEdge.Left, ALEdge.Left, photoTitleSeparator); descriptionHashtagSeparator.AutoPinEdge(ALEdge.Right, ALEdge.Right, photoTitleSeparator); descriptionHashtagSeparator.AutoSetDimension(ALDimension.Height, 1f); tagField.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, descriptionHashtagSeparator); tagField.AutoPinEdge(ALEdge.Left, ALEdge.Left, photoTitleSeparator); tagField.AutoSetDimension(ALDimension.Height, 70f); hashtagImage.AutoSetDimensionsToSize(new CGSize(15, 17)); hashtagImage.AutoPinEdge(ALEdge.Right, ALEdge.Right, photoTitleSeparator); hashtagImage.AutoPinEdge(ALEdge.Left, ALEdge.Right, tagField, 5f); hashtagImage.AutoAlignAxis(ALAxis.Horizontal, tagField); hashtagCollectionSeparator.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, tagField); hashtagCollectionSeparator.AutoPinEdge(ALEdge.Left, ALEdge.Left, photoTitleSeparator); hashtagCollectionSeparator.AutoPinEdge(ALEdge.Right, ALEdge.Right, photoTitleSeparator); hashtagCollectionSeparator.AutoSetDimension(ALDimension.Height, 1f); tagsCollectionView.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, hashtagCollectionSeparator, 25f); tagsCollectionView.AutoPinEdge(ALEdge.Left, ALEdge.Left, photoTitleSeparator); tagsCollectionView.AutoPinEdge(ALEdge.Right, ALEdge.Right, photoTitleSeparator); tagsCollectionHeight = tagsCollectionView.AutoSetDimension(ALDimension.Height, 0f); postPhotoButton.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, tagsCollectionView, 40f); postPhotoButton.AutoPinEdge(ALEdge.Left, ALEdge.Left, photoTitleSeparator); postPhotoButton.AutoPinEdge(ALEdge.Right, ALEdge.Right, photoTitleSeparator); postPhotoButton.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom, 35f); postPhotoButton.AutoSetDimension(ALDimension.Height, 50f); loadingView.AutoAlignAxis(ALAxis.Horizontal, postPhotoButton); loadingView.AutoAlignAxis(ALAxis.Vertical, postPhotoButton); }