イメージボタンを作成したいのですが、イメージがイメージボタンを埋めません。画像は、画像ボタンと同じサイズです。imagebutton には正しい寸法がありますが、imagebutton にはパディングがあるようです?!
ほとんどのスケールタイプを試しました。
私のコード:
ImageButton ib = new ImageButton(Context);
AbsoluteLayout.LayoutParams lp = new AbsoluteLayout.LayoutParams((int)getWidth(3), (int)rowHeight, (int)offsetValue, (int)(offsetRow+row*rowHeight));
Stream bitmap = act.Assets.Open("somefolder/" + name + ".gif");
Bitmap bMap = Android.Graphics.BitmapFactory.DecodeStream(bitmap);
bMap = Bitmap.CreateScaledBitmap(bMap, (int)getWidth(3), (int)rowHeight, false);
ib.SetScaleType(ImageButton.ScaleType.FitXy);
ib.SetAdjustViewBounds(true);
ib.SetImageBitmap(bMap);
bitmap = null;
bMap = null;
ib.LayoutParameters = lp;
layout.AddView(ib);