Creating the POI ListView layout
It is technically possible to create and attach the user interface elements to your activity using C# code. However, it is a bit of a mess. We will go with the most common approach by declaring the XML-based layout. Keeping this in mind, let's begin this chapter by creating a layout to display the POI list items.
When we created the new POIApp
solution in the previous chapter (Chapter 3, Creating the Points Of Interest App), a default layout and activity was created as part of the Xamarin Studio project template.
Rather than deleting these files, let's give them more appropriate names and remove unnecessary content as follows:
Select the
Main.axml
file in Resources | Layout and rename it toPOIList.axml
.Double-click on the
POIList.axml
file to open it in a layout designer window.Currently, the
POIList.axml
file contains the layout that was created as part of the default Xamarin Studio template. As per our requirement, we need to add aListView
widget that takes...