I have my ViewController set up as follows. I realize that my button's parent view is probably not correct but i dont understand what I'm doing wrong. Why isnt the 'ActionCotainer' directly below 'PhotoContainer'. I could really use the help. Thanks.
`public class PhotoSelectView : UIViewController
{
protected UIView PhotoContainer { get; set; }
protected UIImageView PhotoView { get; set; }
protected UITextField PostIDLabel { get; set; }
protected UIView ActionContainer { get; set; } protected UIButton likeButton { get; set; } protected UIButton chatButton { get; set; } nfloat screenWidth = UIScreen.MainScreen.Bounds.Size.Width; nfloat screenHeight = UIScreen.MainScreen.Bounds.Size.Height; UIImage DisplayImage; float buttonSize = 50; float photoLabelHeight = 50; float padding = 15; public PhotoSelectView(UIImage photoForPreview) { DisplayImage = photoForPreview; } public override void ViewDidLoad() { base.ViewDidLoad(); NavigationItem.Title = GlobalConfiguration.SelectedPhotoTitle; View.BackgroundColor = UIColor.White; //ADD Containers PhotoContainer = new UIView { AccessibilityLabel = "PhotoContainer", BackgroundColor = UIColor.White, }; ActionContainer = new UIView { AccessibilityLabel = "ActionContainer", BackgroundColor = UIColor.Red, //ContentMode = UIViewContentMode.ScaleToFill }; View.AddSubview(PhotoContainer); View.AddSubview(ActionContainer); //Add Container subviews PostIDLabel = new UITextField { VerticalAlignment = UIControlContentVerticalAlignment.Center, AccessibilityLabel = "PostID", BackgroundColor = UIColor.White, TextColor = UIColor.Black, Text = "POSTERS NAME WILL GO HERE", }; PhotoView = new UIImageView { AccessibilityLabel = "PhotoPreview", BackgroundColor = UIColor.White, // RESIZE IMAGE BASED ON UIIMAGEVIEW SIZE }; PhotoContainer.Add(PostIDLabel); PhotoContainer.Add(PhotoView); //LIKE BUTTON likeButton = new UIButton(UIButtonType.System); likeButton.Enabled = true; likeButton.SetImage(UIImage.FromBundle("ic_heart"), UIControlState.Normal); likeButton.Tag = 0; likeButton.TouchUpInside += (object sender, EventArgs e) => { Console.WriteLine("liked"); if (likeButton.Tag == 0) { likeButton.SetImage(UIImage.FromBundle("ic_heart_filled"), UIControlState.Normal); likeButton.Tag = 1; } else if (likeButton.Tag == 1) { likeButton.SetImage(UIImage.FromBundle("ic_heart"), UIControlState.Normal); likeButton.Tag = 0; } }; //CHAT BUTTON chatButton = new UIButton(UIButtonType.System); chatButton.SetImage(UIImage.FromBundle("ic_chat"), UIControlState.Normal); chatButton.TouchUpInside += (object sender, EventArgs e) => { Console.WriteLine("Lets Chat"); }; ActionContainer.Add(likeButton); ActionContainer.Add(chatButton); } public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); PostIDLabel.Frame = new CGRect(0, 0, View.Bounds.Width, photoLabelHeight); PhotoView.Frame = new CGRect(0, photoLabelHeight, View.Bounds.Width, View.Bounds.Width); PhotoView.Image = DisplayImage; likeButton.Frame = new CGRect(0, photoLabelHeight + View.Bounds.Width, buttonSize, buttonSize); chatButton.Frame = new CGRect(buttonSize, photoLabelHeight + View.Bounds.Width, buttonSize, buttonSize); View.AddConstraints( PhotoContainer.AtTopOf(View), PhotoContainer.AtLeftOf(View), PhotoContainer.AtRightOf(View), ActionContainer.Below(PhotoContainer), ActionContainer.AtBottomOf(View), ActionContainer.AtLeftOf(View), ActionContainer.AtRightOf(View), PostIDLabel.AtTopOf(PhotoContainer), PostIDLabel.AtLeftOf(PhotoContainer), PostIDLabel.AtRightOf(PhotoContainer), PhotoView.Below(PostIDLabel), PhotoView.AtLeftOf(PhotoContainer), PhotoView.AtRightOf(PhotoContainer), likeButton.AtTopOf(ActionContainer, padding), likeButton.AtLeftOf(ActionContainer, padding), chatButton.AtTopOf(ActionContainer, padding), chatButton.AtLeftOf(likeButton, padding) ); } }`