예제 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            PullUpView.Frame = new RectangleF(0, 0, 320, 320);
            float handleHeight = TabBar.Frame.Height;
            float handleWidth  = 60.0f;

            _pullableView = new PullableView(new RectangleF(0, 0, PullUpView.Frame.Size.Width, PullUpView.Frame.Size.Height + handleHeight));
            _pullableView.OpenedCenter               = new PointF(160, View.Frame.Size.Height - _pullableView.Frame.Size.Height / 2);
            _pullableView.ClosedCenter               = new PointF(160, View.Frame.Size.Height + _pullableView.Frame.Size.Height / 2 - handleHeight);
            _pullableView.Center                     = _pullableView.ClosedCenter;
            _pullableView.BackgroundColor            = UIColor.Clear;
            _pullableView.HandleView.Frame           = new RectangleF(View.Frame.Width / 2 - handleWidth / 2, 0, handleWidth, handleHeight);
            _pullableView.HandleView.BackgroundColor = UIColor.Green;
            View.AddSubview(_pullableView);
            PullUpView.Frame = new RectangleF(0, handleHeight, PullUpView.Frame.Size.Width, PullUpView.Frame.Size.Height);
            _pullableView.AddSubview(PullUpView);
            _pullableView.DidChangeState += (sender, e) => {
                Console.WriteLine("State of Menu: " + (e.Opened ? "Open" : "Closed"));
                PullUpViewController.SetLabelText("State of Menu: " + (e.Opened ? "Open" : "Closed"));
            };
        }
예제 #2
0
 public override void DidChangeState(PullableView pView, bool opened)
 {
     // _label.Text = opened ? "I'm Open. Close Me Now" : "I'm Closed. Open Me Now";
 }