我有下一個問題,我有一個活性1:活動, 用下面的代碼:烤麪包消息問題,Android的ListView
private string[] items;
public ListView lv;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
ListView lv = FindViewById<ListView>(Resource.Id.listView1);
items = new string[] { "Aaaa", "bbb", "cccc", "dddd", "eeee", "ffff", "gggg" };
var ListAdapter = new ArrayAdapter<String>(this, Android.Resource.Layout.SimpleListItem1, items);
lv.Adapter = ListAdapter;
}
protected void OnListClick(ListView listView, View view, int pos, long id)
{
var t = items[pos];
Android.Widget.Toast.MakeText(this, t, Android.Widget.ToastLength.Short).Show();
}
}
的問題如下,當我調試的應用程序,並點擊一排,沒有出現敬酒消息,沒什麼......一些幫助請.....
的XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:p1="http://schemas.android.com/apk/res/android"
p1:orientation="horizontal"
p1:minWidth="25px"
p1:minHeight="25px"
p1:layout_width="fill_parent"
p1:layout_height="fill_parent"
p1:id="@+id/linearLayout1">
<LinearLayout
p1:id="@+id/layoutCalendar"
p1:orientation="horizontal"
p1:layout_width="200.0dp"
p1:layout_height="fill_parent"
p1:layout_gravity="right"
p1:minWidth="25px"
p1:minHeight="25px">
<ListView
p1:minWidth="25px"
p1:minHeight="25px"
p1:layout_width="wrap_content"
p1:layout_height="fill_parent"
p1:id="@+id/listView1" />
</LinearLayout>
<calendarcontrol.CalendarMonthView
p1:id="@+id/calendarView2"
p1:clickable="true"
p1:layout_width="wrap_content"
p1:layout_height="wrap_content"
p1:layout_gravity="right" />
大家好! :) –