我有一个按钮
Android.Widget.Button btnDelTR = new Android.Widget.Button(this);
btnDelTR.SetBackgroundResource(Resource.Drawable.delete);
我想改变它背景它工作正常, 但背景尺寸为拉伸 而我只是想要将背景图像居中
答案 0 :(得分:0)
如果您使用图像按钮可能更容易:
https://developer.xamarin.com/recipes/android/controls/imagebutton/create_an_imagebutton/
您也可以使用图像的参数来调整背景。