本文整理汇总了C#中ImageButton.SetBackgroundColor方法的典型用法代码示例。如果您正苦于以下问题:C# ImageButton.SetBackgroundColor方法的具体用法?C# ImageButton.SetBackgroundColor怎么用?C# ImageButton.SetBackgroundColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageButton
的用法示例。
在下文中一共展示了ImageButton.SetBackgroundColor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: intialButton
private async void intialButton(ImageButton vote, ProgressBar imgVoteLoading,bool voteStat){
if (voteStat == false) {
Picasso.With (context).CancelRequest (vote);
Picasso.With(context).Load(Resource.Drawable.undi2).Into(vote);
vote.SetBackgroundColor (Color.Rgb (103, 155, 251));
} else if (voteStat == true) {
Picasso.With (context).CancelRequest (vote);
Picasso.With(context).Load(Resource.Drawable.batalundi).Into(vote);
vote.SetBackgroundColor (Color.Rgb (227, 100, 100));
}
}
示例2: Initialize
void Initialize ()
{
this.LayoutParameters = new RelativeLayout.LayoutParams(-1,Configuration.getHeight (412));// LinearLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (394));
this.SetGravity(GravityFlags.Center);
image = new RelativeLayout(context);
txtTitle = new TextView (context);
background = new LinearLayout (context);
linearTitle = new LinearLayout (context);
linearButton = new LinearLayout (context);
imgPlay = new ImageButton (context);
video = new VideoView (context);
image.SetGravity (GravityFlags.Bottom);
background.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (111));
background.Orientation = Orientation.Horizontal;
background.SetBackgroundColor (Color.ParseColor ("#50000000"));
linearTitle.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (482), Configuration.getHeight (111));
linearTitle.Orientation = Orientation.Horizontal;
linearTitle.SetGravity (GravityFlags.Center);
linearButton.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (100), Configuration.getHeight (111));
linearButton.Orientation = Orientation.Horizontal;
linearButton.SetGravity (GravityFlags.Center);
image.LayoutParameters = new RelativeLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (394));
//image.SetGravity (GravityFlags.Bottom);
video.LayoutParameters = new ViewGroup.LayoutParams(Configuration.getWidth(582),Configuration.getHeight(394));
imgPlay.Alpha = 255.0f;
imgPlay.SetBackgroundColor (Color.Transparent);
txtTitle.SetTextColor (Color.ParseColor("#ffffff"));
txtTitle.SetPadding (Configuration.getWidth (20), 0, 0, 0);
txtTitle.SetTextSize (ComplexUnitType.Px, Configuration.getHeight (40));
txtTitle.Ellipsize = Android.Text.TextUtils.TruncateAt.End;
txtTitle.SetMaxLines (2);
//imgPlay.SetImageBitmap (Bitmap.CreateStxtcaledBitmap (getBitmapFromAsset ("icons/"), Configuration.getWidth (83), Configuration.getHeight (83), true));
linearTitle.AddView (txtTitle);
linearButton.AddView (imgPlay);
background.AddView (linearTitle);
background.AddView (linearButton);
image.AddView (background);
this.AddView (image);
//this.AddView (background);
}
示例3: InitView
public void InitView(List<BookingDocumentDto> _bookingDocs) {
this.RemoveAllViews ();
int size = _bookingDocs.Count;
for(int i = 0; i < size; i ++) {
LinearLayout ll = new LinearLayout (_context);
ll.Orientation = Orientation.Horizontal;
ll.SetVerticalGravity (GravityFlags.CenterVertical);
ImageView imgFile = new ImageView (_context);
imgFile.SetImageResource (Resource.Drawable.ic_attach);
var tvFileAttach = new TextView (_context) {
Text = _bookingDocs[i].OriginalFileName
};
tvFileAttach.Id = i;
tvFileAttach.SetTextColor (Color.Blue);
tvFileAttach.PaintFlags = PaintFlags.UnderlineText;
tvFileAttach.SetTypeface (null, TypefaceStyle.Bold);
tvFileAttach.SetSingleLine (true);
tvFileAttach.Ellipsize = global::Android.Text.TextUtils.TruncateAt.Middle;
tvFileAttach.SetPadding (5, 0, 10, 0);
LayoutParams param = new TableRow.LayoutParams(0, LayoutParams.WrapContent, 1f);
tvFileAttach.LayoutParameters = param;
tvFileAttach.Click += (sender, e) => {
utilsAndroid.onViewFile(_context, _bookingDocs[tvFileAttach.Id].S3FileName);
};
ImageButton imgDelete = new ImageButton (_context);
imgDelete.Id = i;
imgDelete.SetImageResource (Resource.Drawable.ic_delete);
imgDelete.SetMinimumWidth (50);
imgDelete.SetMinimumHeight (50);
imgDelete.SetBackgroundColor (Color.Transparent);
imgDelete.Click += (sender, e) => {
_deleteFile.onDeleteFile(_isInConference, _bookingDocs[imgDelete.Id]);
};
ll.AddView (imgFile);
ll.AddView (tvFileAttach);
ll.AddView (imgDelete);
ll.SetPadding (0, 5, 0, 5);
this.AddView (ll);
}
}
示例4: GetSampleContent
public override Android.Views.View GetSampleContent(Context context)
{
sfGrid = new SfDataGrid(context);
viewModel = new ExportingViewModel();
sfGrid.AutoGeneratingColumn += GridGenerateColumns;
sfGrid.ItemsSource = (viewModel.OrdersInfo);
exportPdf = new ImageButton(context);
exportPdf.SetMaxHeight(30);
exportPdf.SetMaxWidth(30);
exportPdf.SetBackgroundColor(Android.Graphics.Color.Transparent);
exportPdf.SetImageResource(Resource.Drawable.pdfexport);
exportPdf.SetScaleType(ImageView.ScaleType.FitXy);
exportPdf.LayoutParameters = new ViewGroup.LayoutParams( 120,120);
exportPdf.Click += ExportToPdf;
exportExcel = new ImageButton(context);
exportExcel.SetMaxHeight(30);
exportExcel.SetMaxWidth(30);
exportExcel.SetBackgroundColor(Android.Graphics.Color.Transparent);
exportExcel.SetImageResource(Resource.Drawable.excelexport);
exportExcel.SetScaleType(ImageView.ScaleType.FitXy);
exportExcel.LayoutParameters = new ViewGroup.LayoutParams(120, 120);
exportExcel.Click += ExportToExcel;
LinearLayout option = new LinearLayout(context);
option.SetGravity(GravityFlags.Center);
option.Orientation = Android.Widget.Orientation.Horizontal;
var pdftext = new TextView(context) { Text = "Export to Pdf" };
pdftext.SetTypeface(null, TypefaceStyle.Bold);
var exceltext = new TextView(context) { Text = "Export to Excel" };
exceltext.SetTypeface(null, TypefaceStyle.Bold);
option.AddView(exportPdf);
option.AddView(pdftext);
option.AddView(exportExcel);
option.AddView(exceltext);
LinearLayout mainView = new LinearLayout(context);
mainView.Orientation = Android.Widget.Orientation.Vertical;
mainView.AddView(option);
mainView.AddView(sfGrid);
return mainView;
}
示例5: initButtonColor
public void initButtonColor(ImageButton btn){
btn.Alpha = 255;
//btn.SetAlpha(255);
btn.SetBackgroundColor(Color.Transparent);
}
示例6: init
public void init(){
mainLayout = new RelativeLayout (this);
txtRegister = new TextView (this);
etxtEmail = new EditText (this);
etxtUser = new EditText (this);
etxtPassword = new EditText (this);
btnCreateAccount = new ImageButton (this);
linearButtonRegister = new LinearLayout (this);
linearRegister = new LinearLayout (this);
linearButtonRegister.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent);
linearRegister.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent);
linearButtonRegister.Orientation = Orientation.Horizontal;
linearRegister.Orientation = Orientation.Vertical;
linearButtonRegister.SetGravity (GravityFlags.Center);
linearRegister.SetGravity (GravityFlags.Center);
etxtUser.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
etxtPassword.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
etxtEmail.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);
Drawable drawableBackground = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/cfondo.png"), 768, 1024, true));
mainLayout.SetBackgroundDrawable (drawableBackground);
txtRegister.Text = "Registro";
txtRegister.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtUser.Hint =" Nombre de usuario";
etxtUser.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtEmail.Hint = " Dirección de correo";
etxtEmail.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtPassword.Hint =" Contraseña";
etxtPassword.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
Drawable drawableEditText = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/cajatexto.png"), Configuration.getWidth (507), Configuration.getHeight (80), true));
etxtUser.SetBackgroundDrawable (drawableEditText);
etxtPassword.SetBackgroundDrawable (drawableEditText);
etxtEmail.SetBackgroundDrawable (drawableEditText);
etxtUser.SetTextColor (Color.ParseColor ("#ffffff"));
etxtUser.SetSingleLine (true);
etxtPassword.SetTextColor (Color.ParseColor ("#ffffff"));
etxtPassword.SetSingleLine (true);
etxtEmail.SetTextColor (Color.ParseColor ("#ffffff"));
etxtEmail.SetSingleLine (true);
txtRegister.SetTextColor (Color.ParseColor("#ffffff"));
txtRegister.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (40));
etxtPassword.InputType = InputTypes.TextVariationVisiblePassword;
etxtPassword.TransformationMethod = Android.Text.Method.PasswordTransformationMethod.Instance;
btnCreateAccount.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/crearcuenta.png"), Configuration.getWidth (507), Configuration.getHeight (80), true));
btnCreateAccount.Alpha = 255;
//btn.SetAlpha(255);
btnCreateAccount.SetBackgroundColor(Color.Transparent);
LinearLayout space = new LinearLayout (this);
space.LayoutParameters = new LinearLayout.LayoutParams (-1, 20);
LinearLayout space2 = new LinearLayout (this);
space2.LayoutParameters = new LinearLayout.LayoutParams (-1, 20);
linearRegister.AddView (etxtUser);
linearRegister.AddView (space);
linearRegister.AddView (etxtEmail);
linearRegister.AddView (space2);
linearRegister.AddView (etxtPassword);
linearButtonRegister.AddView (btnCreateAccount);
txtRegister.SetX (Configuration.getWidth(72)); txtRegister.SetY (Configuration.getHeight(535));
linearRegister.SetX (0); linearRegister.SetY (Configuration.getHeight(592));
linearButtonRegister.SetX (0); linearButtonRegister.SetY (Configuration.getHeight(975));
mainLayout.AddView (txtRegister);
mainLayout.AddView (linearRegister);
mainLayout.AddView (linearButtonRegister);
//string ndef = "None" ;
//string foto = "http://www.clinicatorielli.com/img/icons/no-user.png";
EditText lastName = new EditText (this);
lastName.Text = "None";
EditText url = new EditText (this);
url.Text = "http://www.clinicatorielli.com/img/icons/no-user.png";
//.........这里部分代码省略.........