0

So I have this problem where I have this view structure:

Controller->View->ScrollView->mainview

and I have a button that's loaded in the mainview, but outside of scrollview's visible content. When I scroll up to see the button, the touch doesn't work, but if I place the button to load in the visible area it works.

I also tried with a simple imageview and setting a gesture recognizer (with user interaction enabled) and the problem is exactly the same.

This is where I define the button:

 UIButton scrapbookbackground = new UIButton(new CGRect(SPACING, progresses_view.Frame.Y + progresses_view.Frame.Height + SPACING, View.Frame.Width - SPACING * 2, 90));
        scrapbookbackground.BackgroundColor = UIColor.Clear.FromHex(0x4f80bc);
        scrapbookbackground.Layer.CornerRadius = 10f;
        scrapbookbackground.Layer.BorderWidth = 1f;
        scrapbookbackground.Layer.BorderColor = UIColor.Blue.CGColor;
        scrapbookbackground.ClipsToBounds = true;

        scrapbookimg = UIImage.FromFile("Images/scrap_capa.png");
        scrapbookbackground.SetBackgroundImage(scrapbookimg, UIControlState.Normal);

        scrapbookbackground.TouchUpInside += (args, e) => {
            Console.WriteLine("scrapbooktouch");
            NavigationController.PushViewController(new ScrapBookPageViewController(), true);
        };

        mainview.Add(scrapbookbackground);
Tophandour
  • 297
  • 5
  • 15

1 Answers1

0

figured it out. was not setting contentsize of scrollview properly.