私のアプリケーションでビットマップのサイズ変更を行っています。 Bitmap Imagesというフォルダがあり、ビットマップのサイズ変更を開始する機能があります。しかし、私のアダプタ(このコード行)でhold.Img.SetImageBitmap(BitmapImages.decodeSampledBitmapFromResource(getResources(),news[position].Image,100,100));
、最初のパラメータgetResource
がエラーとして発生します。何が欠けている?BitMapイメージの読み込み - Xamarin.Andoird
public class MyAdapter : RecyclerView.Adapter
{
private JavaList<News> news;
public MyAdapter(JavaList<News> news)
{
this.news = news;
}
//binding data to views
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
{
MyHolder hold = holder as MyHolder;
hold.Comment.Text = news[position].Comment;
//hold.Img.SetImageResource(news[position].Image);
hold.Img.SetImageBitmap(BitmapImages.decodeSampledBitmapFromResource(getResources(),news[position].Image,100,100));
}
あなたのエラー – Yupi
@Yupiを投稿するリソースがすでに – XamarinDevil