私はMonoDroid/Android開発にかなり慣れていないので、誰かが私にサンプルを紹介したり、カスタムListViewを使用してAlertDialogを作成する方法を説明したりできるかどうか疑問に思っていました。
画像付きの名前のリストが必要です。次のようなリストを使用してAlertDialogを作成できます。
List<string> sPeople = new List<string>();
for (int ndx = 0; ndx < od.PeopleAtLoc.Count; ndx++)
{
ObjectPeople d = od.PeopleAtLoc[ndx];
sPeople.Add (d.Name + "\n" + d.Type);
}
string[] stuff = sPeople.ToArray();
new AlertDialog.Builder(this)
.SetTitle("Choose a Person:")
.SetItems(stuff, (sender, args) =>
{
_bInDetails = true;
Intent intent = new Intent(this, typeof(FindAPersonDetailActivity));
intent.PutExtra("PERSON_ID", od.PeopleAtLoc[(int)args.Which].ID);
intent.PutExtra ("PERSON_CITY", od.PeopleAtLoc[(int)args.Which].City);
StartActivity(intent);
})
.Show();
しかし、私は本当に各アイテムに関連付けられた画像を持っている必要があります。そのため、ListViewでAlertDialogを使用できることを望んでいました。
助けてくれてありがとう!