Book Image

Xamarin Mobile Application Development for Android, Second Edition

Book Image

Xamarin Mobile Application Development for Android, Second Edition

Overview of this book

Table of Contents (18 chapters)
Xamarin Mobile Application Development for Android Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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:

  1. Select the Main.axml file in Resources | Layout and rename it to POIList.axml.

  2. 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 a ListView widget that takes...