ArcGISRuntimeXamarin.Samples.DisplayDrawingStatus.DisplayDrawingStatus.CreateLayout C# (CSharp) Method

CreateLayout() private method

private CreateLayout ( ) : void
return void
        private void CreateLayout()
        {
            // Create a new MapView control and provide its location coordinates on the frame
            _myMapView = new MapView();
            _myMapView.Frame = new CoreGraphics.CGRect(0, yPageOffset, View.Bounds.Width, View.Bounds.Height - 30);

            // Create a toolbar on the bottom of the display 
            UIToolbar toolbar = new UIToolbar();
            toolbar.Frame = new CoreGraphics.CGRect(0, _myMapView.Bounds.Height, View.Bounds.Width, 30);

            // Create an activity indicator
            _activityIndicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.Gray);
            _activityIndicator.Frame = new CoreGraphics.CGRect(0, 0, toolbar.Bounds.Width, toolbar.Bounds.Height);

            // Create a UIBarButtonItem to show the activity indicator
            UIBarButtonItem indicatorButton = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace);
            indicatorButton.CustomView = _activityIndicator;

            // Add the indicatorButton to an array of UIBarButtonItems
            var barButtonItems = new UIBarButtonItem[] { indicatorButton };

            // Add the UIBarButtonItems to the toolbar
            toolbar.SetItems(barButtonItems, true);

            // Add the MapView to the Subview
            View.AddSubviews(_myMapView, toolbar);
        }
    }