本文整理汇总了C#中ImageButton.SetPadding方法的典型用法代码示例。如果您正苦于以下问题:C# ImageButton.SetPadding方法的具体用法?C# ImageButton.SetPadding怎么用?C# ImageButton.SetPadding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageButton
的用法示例。
在下文中一共展示了ImageButton.SetPadding方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: init
public void init(){
mainLayout = new RelativeLayout (this);
mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);
linearButtons = new LinearLayout (this);
linearImageCamera = new LinearLayout (this);
LinearImageText = new LinearLayout (this);
LinearTextCamera = new LinearLayout (this);
linearButtons.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
linearImageCamera.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
LinearImageText.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
LinearTextCamera.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
linearButtons.Orientation = Orientation.Horizontal;
linearImageCamera.Orientation = Orientation.Horizontal;
LinearImageText.Orientation = Orientation.Horizontal;
LinearTextCamera.Orientation = Orientation.Vertical;
//linearButtons.SetGravity (GravityFlags.Center);
linearImageCamera.SetGravity (GravityFlags.Center);
LinearImageText.SetGravity (GravityFlags.Center);
LinearTextCamera.SetGravity (GravityFlags.Center);
Drawable dr = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/bfondo.png"), 1024, 768, true));
mainLayout.SetBackgroundDrawable (dr);
imgCamera = new ImageView (this);
imgLineal = new ImageView (this);
btnCamera = new ImageButton (this);
btnRepository = new ImageButton (this);
btnDone = new ImageButton (this);
txtCamera = new TextView (this);
txtCamera.Text = "CHOOSE A PICTURE AND \n SELECT A COLOUR";
txtCamera.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtCamera.SetTextSize(Android.Util.ComplexUnitType.Px,Configuration.getHeight(30));
txtCamera.SetTextColor (Color.ParseColor ("#ffffff"));
Button bt = new Button (this);
imgCamera.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/camara.png"), Configuration.getWidth(164),Configuration.getHeight(164),true));
imgLineal.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/colores.png"), Configuration.getWidth(542), 5,true));
btnCamera.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/loadcamara.png"), Configuration.getWidth(58),Configuration.getHeight(50),true));
btnRepository.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/loadbiblioteca.png"), Configuration.getWidth(58),Configuration.getHeight(50),true));
btnDone.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/adelante.png"), Configuration.getWidth(20),Configuration.getWidth(30),true));
imgCamera.Click += delegate {
var com = ((CameraViewModel)this.DataContext).TakePictureCommand;
com.Execute (null);
};
linearButtons.AddView (btnCamera);
linearButtons.AddView (btnRepository);
btnCamera.SetPadding (Configuration.getWidth(122),0,0,0);
btnRepository.SetPadding (Configuration.getWidth(300),0,0,0);
linearImageCamera.AddView (imgCamera);
txtCamera.SetPadding (0, Configuration.getHeight(70), 0, 0);
LinearImageText.AddView (txtCamera);
LinearTextCamera.AddView (linearImageCamera);
LinearTextCamera.AddView (LinearImageText);
LinearTextCamera.SetX (0); LinearTextCamera.SetY (Configuration.getHeight(295));
linearButtons.SetX (0); linearButtons.SetY (Configuration.getHeight(926));
imgLineal.SetX (Configuration.getWidth(61)); imgLineal.SetY (Configuration.getHeight(1019));
btnDone.SetX (Configuration.getWidth(550)); btnDone.SetY (Configuration.getHeight(40));
mainLayout.AddView (btnDone);
mainLayout.AddView (LinearTextCamera);
mainLayout.AddView (linearButtons);
mainLayout.AddView (imgLineal);
initButtonColor (btnCamera);
initButtonColor (btnRepository);
initButtonColor (btnDone);
btnCamera.Click += delegate {
var com = ((CameraViewModel)this.DataContext).TakePictureCommand;
com.Execute(null);
};
btnRepository.Click += delegate {
var com = ((CameraViewModel)this.DataContext).ChoosePictureCommand;
com.Execute(null);
};
Bitmap bm;
var vm = this.ViewModel as CameraViewModel;
if (vm.Bytes != null)
{
bm= BitmapFactory.DecodeByteArray(vm.Bytes, 0, vm.Bytes.Length);
imgCamera.SetImageBitmap (bm);
}
//.........这里部分代码省略.........