O'Reilly logo

Xamarin Studio for Android Programming: A C# Cookbook by Mathieu Nayrolles

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Populating ListView

A popular alternative to a spinner is the ListView instance. The ListView instances are views that will show a list of items in full screen with a vertical scrolling. In other words, it is equivalent to a full screen spinner, which is always active.

Getting ready

In order to follow this recipe, create a new project in the very same solution and name it Populating ListView.

How to do it...

  1. Edit the Main.axml file under Resource/Layout file with the following:
    <?xml version="1.0" encoding="utf-8"?>
    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/textItem"
      android:textSize="44sp"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content" />
  2. Create another .axml file under Resource

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required