Skip to content

Commit

Permalink
Updates to iOS samples issues reported in certification (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
semcilreavy authored Jun 5, 2017
1 parent f536fe3 commit 0e88e59
Show file tree
Hide file tree
Showing 37 changed files with 475 additions and 291 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ public override void ViewDidLoad()
public override void ViewDidLayoutSubviews()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(
0, yPageOffset + 80, View.Bounds.Width, View.Bounds.Height - yPageOffset - 80);
_myMapView.Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);

// Setup the visual frame for the text field used in query
_queryTextView.Frame = new CoreGraphics.CGRect(0, yPageOffset, View.Bounds.Width, 40);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,21 @@ public ServiceFeatureTableCache()
Title = "Service feature table (cache)";
}

public override void ViewDidLayoutSubviews()
public override void ViewDidLoad()
{
base.ViewDidLayoutSubviews();
base.ViewDidLoad();

// Create the UI, setup the control references and execute initialization
CreateLayout();
Initialize();
}

public override void ViewDidLayoutSubviews()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);
}

private void Initialize()
{
// Create new Map with basemap
Expand Down Expand Up @@ -75,10 +81,6 @@ private void Initialize()

private void CreateLayout()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(
0, yPageOffset, View.Bounds.Width, View.Bounds.Height - yPageOffset);

// Add MapView to the page
View.AddSubviews(_myMapView);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,21 @@ public ServiceFeatureTableManualCache()
Title = "Service feature table (manual cache)";
}

public override void ViewDidLayoutSubviews()
public override void ViewDidLoad()
{
base.ViewDidLayoutSubviews();
base.ViewDidLoad();

// Create the UI, setup the control references and execute initialization
CreateLayout();
Initialize();
}

public override void ViewDidLayoutSubviews()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);
}

private void Initialize()
{
// Create new Map with basemap
Expand Down Expand Up @@ -96,10 +102,6 @@ private async void OnLoadedPopulateData(object sender, Esri.ArcGISRuntime.LoadSt

private void CreateLayout()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(
0, yPageOffset, View.Bounds.Width, View.Bounds.Height - yPageOffset);

// Add MapView to the page
View.AddSubviews(_myMapView);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,21 @@ public ServiceFeatureTableNoCache()
Title = "Service feature table (no cache)";
}

public override void ViewDidLayoutSubviews()
public override void ViewDidLoad()
{
base.ViewDidLayoutSubviews();
base.ViewDidLoad();

// Create the UI, setup the control references and execute initialization
CreateLayout();
Initialize();
}

public override void ViewDidLayoutSubviews()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);
}

private void Initialize()
{
// Create new Map with basemap
Expand Down Expand Up @@ -76,10 +82,6 @@ private void Initialize()

private void CreateLayout()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(
0, yPageOffset, View.Bounds.Width, View.Bounds.Height - yPageOffset);

// Add MapView to the page
View.AddSubviews(_myMapView);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ public AddGraphicsRenderer()
Title = "Add graphics (Renderer)";
}

public override void ViewDidLayoutSubviews()
public override void ViewDidLoad()
{
base.ViewDidLayoutSubviews();
base.ViewDidLoad();

// Create the UI, setup the control references and execute initialization
CreateLayout();
Initialize();
}
public override void ViewDidLayoutSubviews()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);
}

private void Initialize()
{
Expand Down Expand Up @@ -114,10 +119,6 @@ private void OnViewpointChanged(object sender, EventArgs e)

private void CreateLayout()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(
0, yPageOffset, View.Bounds.Width, View.Bounds.Height - yPageOffset);

// Add MapView to the page
View.AddSubviews(_myMapView);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ public override void ViewDidLoad()
Initialize();
}

public override void ViewDidLayoutSubviews()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);
}

private void Initialize()
{
// Create a map with 'Imagery with Labels' basemap and an initial location
Expand Down Expand Up @@ -117,10 +123,6 @@ private async void OnMapViewTapped(object sender, GeoViewInputEventArgs e)

private void CreateLayout()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(
0, yPageOffset, View.Bounds.Width, View.Bounds.Height - yPageOffset);

// Add MapView to the page
View.AddSubviews(_myMapView);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public SketchOnMap()
Title = "Sketch on map";
}

public override void ViewDidLayoutSubviews()
public override void ViewDidLoad()
{
base.ViewDidLayoutSubviews();
base.ViewDidLoad();

// Create the UI
CreateLayout();
Expand All @@ -57,6 +57,12 @@ public override void ViewDidLayoutSubviews()
Initialize();
}

public override void ViewDidLayoutSubviews()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);
}

private void Initialize()
{
// Create a light gray canvas map
Expand Down Expand Up @@ -89,9 +95,6 @@ private void CreateLayout()
// Create a new MapView control
_myMapView = new MapView();

// Define the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(0, yPageOffset, View.Bounds.Width, View.Bounds.Height - yPageOffset);

// Add a segmented button control
_segmentButton = new UISegmentedControl();
_segmentButton.BackgroundColor = UIColor.White;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,23 @@ public ArcGISMapImageLayerUrl()
Title = "ArcGIS map image layer (URL)";
}

public override void ViewDidLayoutSubviews()
public override void ViewDidLoad()
{
base.ViewDidLayoutSubviews();
base.ViewDidLoad();

// Create the UI, setup the control references and execute initialization
CreateLayout();
Initialize();
}

public override void ViewDidLayoutSubviews()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);

base.ViewDidLayoutSubviews();
}

private void Initialize()
{
// Create new Map
Expand All @@ -59,10 +67,6 @@ private void Initialize()

private void CreateLayout()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(
0, yPageOffset, View.Bounds.Width, View.Bounds.Height - yPageOffset);

// Add MapView to the page
View.AddSubviews(_myMapView);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,23 @@ public ArcGISTiledLayerUrl()
Title = "ArcGIS tiled layer (URL)";
}

public override void ViewDidLayoutSubviews()
public override void ViewDidLoad()
{
base.ViewDidLayoutSubviews();
base.ViewDidLoad();

// Create the UI, setup the control references and execute initialization
CreateLayout();
Initialize();
}

public override void ViewDidLayoutSubviews()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);

base.ViewDidLayoutSubviews();
}

private void Initialize()
{
// Create new Map
Expand All @@ -59,10 +67,6 @@ private void Initialize()

private void CreateLayout()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(
0, yPageOffset, View.Bounds.Width, View.Bounds.Height - yPageOffset);

// Add MapView to the page
View.AddSubviews(_myMapView);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class ArcGISVectorTiledLayerUrl : UIViewController
{
// Create and hold reference to the used MapView
private MapView _myMapView = new MapView();
UIToolbar _toolbar;

private string _navigationUrl = "https://www.arcgis.com/home/item.html?id=dcbbba0edf094eaa81af19298b9c6247";
private string _streetUrl = "https://www.arcgis.com/home/item.html?id=4e1133c28ac04cca97693cf336cd49ad";
Expand All @@ -41,16 +42,12 @@ public override void DidReceiveMemoryWarning()
base.DidReceiveMemoryWarning();
}

public override void ViewDidLayoutSubviews()
public override void ViewDidLoad()
{
base.ViewDidLayoutSubviews();

// Create a variable to hold the yOffset where the MapView control should start
var yOffset = 60;
base.ViewDidLoad();

// Create a new MapView control and provide its location coordinates on the frame
MapView myMapView = new MapView();
myMapView.Frame = new CoreGraphics.CGRect(0, yOffset, View.Bounds.Width, View.Bounds.Height - yOffset);
_myMapView = new MapView();

// Create a new Map instance with the basemap
Map myMap = new Map(SpatialReferences.WebMercator);
Expand All @@ -61,7 +58,7 @@ public override void ViewDidLayoutSubviews()
myMap.Basemap = new Basemap(_vectorTiledLayer);

// Assign the Map to the MapView
myMapView.Map = myMap;
_myMapView.Map = myMap;

// Create a segmented control to display buttons
UISegmentedControl segmentControl = new UISegmentedControl();
Expand Down Expand Up @@ -104,25 +101,35 @@ public override void ViewDidLayoutSubviews()
_vectorTiledLayer = new ArcGISVectorTiledLayer(new Uri(_vectorTiledLayerUrl));

// Create new Map with basemap and assigning to the Mapviews Map
myMapView.Map = new Map(new Basemap(_vectorTiledLayer));
_myMapView.Map = new Map(new Basemap(_vectorTiledLayer));
};

// Create a UIBarButtonItem where its view is the SegmentControl
UIBarButtonItem barButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace);
barButtonItem.CustomView = segmentControl;

// Create a toolbar on the bottom of the display
UIToolbar toolbar = new UIToolbar();
toolbar.Frame = new CoreGraphics.CGRect(0, View.Bounds.Height - 40, View.Bounds.Width, View.Bounds.Height);
toolbar.AutosizesSubviews = true;
_toolbar = new UIToolbar();

_toolbar.AutosizesSubviews = true;

// Add the bar button item to an array of UIBarButtonItems
UIBarButtonItem[] barButtonItems = new UIBarButtonItem[] { barButtonItem };

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

View.AddSubviews(_myMapView, _toolbar);
}

View.AddSubviews(myMapView, toolbar);
public override void ViewDidLayoutSubviews()
{
// Setup the visual frame for the MapView
_myMapView.Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);

_toolbar.Frame = new CoreGraphics.CGRect(0, View.Bounds.Height - 40, View.Bounds.Width, View.Bounds.Height);

base.ViewDidLayoutSubviews();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace ArcGISRuntimeXamarin.Samples.ChangeFeatureLayerRenderer
public class ChangeFeatureLayerRenderer : UIViewController
{
// Create and hold reference to the used MapView
private MapView _myMapView = new MapView();
private MapView _myMapView;

//Create and hold reference to the feature layer
private FeatureLayer _featureLayer;
Expand Down
Loading

0 comments on commit 0e88e59

Please sign in to comment.