コード例 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _mapDelegate = new ExampleBindingMapDelegate();

            InitializeSubviews();
            LayoutSubviews();
            DoBindings();
        }
コード例 #2
0
        private void InitializeSubviews()
        {
            _mapView = new BindingMKMapView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                ScrollEnabled          = true,
                UserInteractionEnabled = true,
                Delegate  = _mapDelegate,
                ZoomLevel = 72.25
            };
            _mapDelegate = new ExampleBindingMapDelegate(_mapView);

            _info = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false
            };

            _latitude = new UITextView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                TextAlignment = UITextAlignment.Right
            };

            _longitude = new UITextView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false
            };

            _colon = new UITextView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Text = ":",
            };

            _toggleButton = new UIButton()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                BackgroundColor = UIColor.Black
            };
            _toggleButton.SetTitle("User Location", UIControlState.Normal);

            View.AddSubviews(_mapView, _info, _toggleButton);
            _info.AddSubviews(_latitude, _longitude, _colon);
        }