Example #1
0
        public PolyLibView ResizeView(int boundsWidth, int boundsHeight, List <UIGestureRecognizer> recognizers)//, View.IOnTouchListener listener = null)
        {
            //SKCanvasView cannot change size. Instead, generate a new one in this views place
            var newFrame = new CGRect(Frame.Location, new CGSize(boundsWidth, boundsHeight));

            var newCanvasView = new PolyLibView(newFrame);

            //setup gesture recognizers
            foreach (var recognizer in recognizers)
            {
                newCanvasView.AddGestureRecognizer(recognizer);
                RemoveGestureRecognizer(recognizer);
            }

            Superview.InsertSubviewAbove(newCanvasView, this);
            RemoveFromSuperview();

            return(newCanvasView);
        }