• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Listbox with button

wilko100

Lurker
Hi

Complete newbie here. Im trying to create a layout with a couple of controls at the top of a listbox (List View i think its referred to in Android). Im really struggling to get this to happen. I have used the listview examples out there however the all fill the whole screen.
How do i get a listview on the same layout page as my controls. So far i can get all controls in but the listbox is not displaying anything.

Heres my code:

C# (Using Monodrod IDE)

protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);

SetContentView(Resource.Layout.Main);
ListAdapter =
new ArrayAdapter<string>(this, Resource.Id.Tracklist, countries);



}

XML (Main.amxl)

<?xml version="1.0" encoding="utf-8"?>
<
RelativeLayout
android:id="@+id/widget0"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<
EditText
android:id="@+id/TrackSearch"
android:text="Enter Parcel Number Here"
android:layout_width="365px"
android:layout_height="80px"
android:layout_marginTop="60px"
/>
<
Button
android:id="@+id/Trackbutton"
android:text="Track"
android:layout_width="100px"
android:layout_height="80px"
android:layout_alignParentRight="True"
android:layout_marginTop="60px"
/>
<ListView
android:id="@+id/Tracklist"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerHorizontal="@+id/TrackSearch"
/>&#12288;
</RelativeLayout>

 
Back
Top Bottom