Exemplo n.º 1
0
 public override void ViewDidUnload()
 {
     base.ViewDidUnload();
     if (_view != null)
     {
         _view.Dispose();
         _view = null;
     }
 }
Exemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            AppDelegate.NavigationBar.SetBackButtonOn(this);

            SetBackgroundView(Util.IsLandscape());

            if (_view != null)
            {
                _view.Dispose();
                _view = null;
            }

            // Set up our custom ScrollView
            _view = new PieceFullView(View.Bounds);
            _view.BackgroundColor                = UIColor.Clear;
            _view.AutoresizingMask               = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            _view.ShowsVerticalScrollIndicator   = false;
            _view.ShowsHorizontalScrollIndicator = false;
            _view.BouncesZoom = true;
            _view.Delegate    = new ScrollViewDelegate();

            // Added by me (snap back does not occur on device)
            _view.UserInteractionEnabled = true;
            _view.MultipleTouchEnabled   = true;
            _view.ScrollsToTop           = false;
            _view.PagingEnabled          = false;

            View.AddSubview(_view);

            // Set up the ImageView that's going inside our scroll view
            UIImage     image = UIImageEx.FromFile(_piece.Source);
            UIImageView iv    = new UIImageView(image);

            image.Dispose();

            iv.Layer.ShadowPath      = UIBezierPath.FromRect(iv.Bounds).CGPath;
            iv.Layer.ShouldRasterize = true;
            iv.Layer.MasksToBounds   = false;
            iv.Layer.ShadowColor     = UIColor.Black.CGColor;
            iv.Layer.ShadowOpacity   = 1.0f;
            iv.Layer.ShadowRadius    = 10.0f;
            iv.Layer.ShadowOffset    = new SizeF(0f, 1f);

            // Finish the ScrollView setup
            _view.ContentSize = iv.Frame.Size;
            _view.SetChildView(iv);

            _view.MaximumZoomScale = 2.0f;
            SetMinimumZoomForCurrentFrame();
            _view.SetZoomScale(_view.MinimumZoomScale, false);
        }
Exemplo n.º 3
0
		public override void ViewDidUnload()
		{
			base.ViewDidUnload();
			if(_view != null)
			{
				_view.Dispose();
				_view = null;			
			}
		}
Exemplo n.º 4
0
		public override void ViewDidLoad()
		{
			base.ViewDidLoad();
			AppDelegate.NavigationBar.SetBackButtonOn(this);
			
			SetBackgroundView(Util.IsLandscape());
			
			if(_view != null)
			{
				_view.Dispose();
				_view = null;
			}
			
			// Set up our custom ScrollView
			_view = new PieceFullView(View.Bounds);
			_view.BackgroundColor = UIColor.Clear;
			_view.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
			_view.ShowsVerticalScrollIndicator = false;
			_view.ShowsHorizontalScrollIndicator = false;
			_view.BouncesZoom = true;
			_view.Delegate = new ScrollViewDelegate();
			
			// Added by me (snap back does not occur on device)
			_view.UserInteractionEnabled = true;
			_view.MultipleTouchEnabled = true;
			_view.ScrollsToTop = false;
			_view.PagingEnabled = false;
			
			View.AddSubview(_view);
			
			// Set up the ImageView that's going inside our scroll view
			UIImage image = UIImageEx.FromFile(_piece.Source);
			UIImageView iv = new UIImageView(image);
			image.Dispose();
			
			iv.Layer.ShadowPath = UIBezierPath.FromRect(iv.Bounds).CGPath;
			iv.Layer.ShouldRasterize = true;
			iv.Layer.MasksToBounds = false;
			iv.Layer.ShadowColor = UIColor.Black.CGColor;
			iv.Layer.ShadowOpacity = 1.0f;
			iv.Layer.ShadowRadius = 10.0f;
			iv.Layer.ShadowOffset = new SizeF(0f, 1f);
			
			// Finish the ScrollView setup
			_view.ContentSize = iv.Frame.Size;
			_view.SetChildView(iv);
			
			_view.MaximumZoomScale = 2.0f;
			SetMinimumZoomForCurrentFrame();			
			_view.SetZoomScale(_view.MinimumZoomScale, false);
		}