Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

UIScrollView not behaving

$
0
0

Been wrestling with this issue on and off for the past week -- though sometimes when I boot up the app everything works as expected, 90% of the time my ScrollView won't behave. It's not scrolling but the DraggingStarted event is firing so I know it's getting touch input. Has anyone else experienced this?

public override void ViewDidLoad () { base.ViewDidLoad ();

View.UserInteractionEnabled = true;

ScrollContainer = new UIScrollView (new RectangleF(0,0,UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height));
ScrollContainer.Bounces = false;
ScrollContainer.ShowsVerticalScrollIndicator = false;
ScrollContainer.UserInteractionEnabled = true;
ScrollContainer.BackgroundColor = UIColor.White;
ScrollContainer.CanCancelContentTouches = true;
ScrollContainer.TranslatesAutoresizingMaskIntoConstraints = true;
ScrollContainer.ScrollEnabled = true;
ScrollContainer.DraggingStarted += DebugScrollView;
View.AddSubview (ScrollContainer);
View.BringSubviewToFront (ScrollContainer);

ScrollContainer.Add(new ProfileView (this));

}

I'm setting the content size with this method -- when I write the size to the console it is accurate

public void ResizeScrollViewContent(){ float y = 0; foreach(var sub in ScrollContainer.Subviews){ y += sub.Frame.Height; } ScrollContainer.ContentSize = new SizeF (UIScreen.MainScreen.Bounds.Width, y); }


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>