0
하나의 xamarin android 앱을 개발 중입니다. 여기서 하나의 listview를 구현했습니다. 그래서 내가 listview에 그 이미지를 표시해야합니다 어떻게 이미지 뷰를 사용하여 경로를 사용하여 이미지를 표시합니다.DIsplay 이미지를 로컬 저장소에서 가져옵니다.
class AlbumTable
{
[PrimaryKey]
public string Id { get; set; }
public string ZipFillPath { get; set; }
public string CoverPhotoPath { get; set; }
public string AlbumKey { get; set; }
public string NoOfPages { get; set; }
public string Email { get; set; }
public string LastName { get; set; }
public string FirstName { get; set; }
public string City { get; set; }
public string Address1 { get; set; }
public string ZipPostalCode { get; set; }
public string PhoneNumber { get; set; }
}
을 다음과 같이내가 여기 xamarin.android
내 CustomAdaptor에서 파일 경로에서 이미지를 표시하는 방법을 받고 있지 않다
internal class MyCustomListAdapter : BaseAdapter
{
private List<AlbumTable> albm;
private LayoutInflater mInflater;
Context c;
Dialog dialog;
public MyCustomListAdapter(Context c,List<AlbumTable> albm)
{
this.albm = albm;
this.c = c;
mInflater = (LayoutInflater)c.GetSystemService(Context.LayoutInflaterService);
}
public override int Count
{
get
{
return albm.Count();
}
}
public override Java.Lang.Object GetItem(int position)
{
return null;
}
public override long GetItemId(int position)
{
return long.Parse(albm[position].Id);
}
public override View GetView(int position, View view, ViewGroup parent)
{
Button btnDelete;
ViewHolder1 holder = null;
if (view == null)
{
view = mInflater.Inflate(Resource.Layout.inflate_album, null);
holder = new ViewHolder1();
holder.coverp = view.FindViewById<ImageView>(Resource.Id.sliderviewpager);
btnDelete = view.FindViewById<Button>(Resource.Id.share_album);
btnDelete.Focusable = false;
btnDelete.FocusableInTouchMode = false;
btnDelete.Clickable = true;
btnDelete.Click += (object sender, EventArgs e) =>
{
Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(c);
alert.SetTitle("Delete Album");
alert.SetMessage("Are you really wnt to delete the Album");
alert.SetCancelable(false);
alert.SetPositiveButton("Yes", delegate {
DatabaseHelper db = new DatabaseHelper();
bool aa=db.DeleteFromTable(albm[position]);
if (aa)
{
Toast.MakeText(c, "Album Deleted Successfully", ToastLength.Short).Show();
}
});
alert.SetNegativeButton("No", delegate {
if (dialog.IsShowing)
dialog.Dismiss();
});
dialog = alert.Create();
dialog.Show();
};
}
else
{
btnDelete = view.FindViewById<Button>(Resource.Id.share_album);
holder = view.Tag as ViewHolder1;
btnDelete.Tag = position;
}
return view;
}
내 게터 세터 방법입니다
경로를 사용하여 이미지 뷰에 이미지를 표시하는 방법.