Scrollview of whole page is not working when I added Tap to zoom view(Image) functionality in xamarin iOS.
I have two scrollview-one is using for tap to zoom functionality and another scroll-scroll2 which is used to scroll the whole details page.This scrooll2 is not working but Tap to Zoom is working fine.
scrollView = new UIScrollView(
new CGRect(0, 80,View.Frame.Width
, View.Frame.Height -200));
View.AddSubview(scrollView);
scroll2.ScrollEnabled = true;
scroll2.ContentSize = new CGSize(0f, 1760f);
scrollView.ScrollEnabled = false;
ImageService.Instance.LoadUrl(GlobalVar.imgpath + travelerlistdetail.orderDetails.product_image) .Retry(3, 200) .DownSample(100, 100) .Into(ImgProd);
//scrollView.ContentSize = ImgProd.Size;
scrollView.AddSubview(ImgProd);
scrollView.MinimumZoomScale = 0.9f;
scrollView.MaximumZoomScale = 3f;
//scrollView.PinchGestureRecognizer.Enabled = false;
//await Task.Delay(2000);
//scrollView.ContentSize = ImgProd.Image.Size;
scrollView.ViewForZoomingInScrollView += (UIScrollView sv) => { return ImgProd; };
UITapGestureRecognizer doubletap = new UITapGestureRecognizer(OnDoubleTap)
{
NumberOfTapsRequired = 1 // double tap
};
scrollView.AddGestureRecognizer(doubletap);
private void OnDoubleTap(UIGestureRecognizer gesture) { scroll2.ScrollEnabled = false; scrollView.ScrollEnabled = true; if (scrollView.ZoomScale > 1) scrollView.SetZoomScale(0.25f, true); else scrollView.SetZoomScale(3f, true); }
scroll2 is total page's scroll and scrollview is the imageview scroll when zoom in
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.