当前位置: 首页>>代码示例>>C#>>正文


C# CheckBox.SetBackgroundColor方法代码示例

本文整理汇总了C#中CheckBox.SetBackgroundColor方法的典型用法代码示例。如果您正苦于以下问题:C# CheckBox.SetBackgroundColor方法的具体用法?C# CheckBox.SetBackgroundColor怎么用?C# CheckBox.SetBackgroundColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CheckBox的用法示例。


在下文中一共展示了CheckBox.SetBackgroundColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: init


//.........这里部分代码省略.........
			relLogin.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);


			linearLicencia.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
			linearLicencia.Orientation = Orientation.Horizontal;
			linearLicencia.SetGravity (GravityFlags.Center);

			linearLogin.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
			linearLogin.Orientation = Orientation.Horizontal;
			linearLogin.SetGravity (GravityFlags.Right);

			linearSingup.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
			linearSingup.Orientation = Orientation.Vertical;
			linearSingup.SetGravity (GravityFlags.Center);


			linearLogo.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
			linearLogo.Orientation = Orientation.Vertical;
			linearLogo.SetGravity (GravityFlags.Center);



			txtLicencia_a.Text = "TO REGISTER, ACCEPT THE";
			txtLicencia_a.SetTextSize(textFormat,Configuration.getHeight(25));
			txtLicencia_a.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
			txtLicencia_a.SetTextColor (Color.ParseColor ("#ffffff"));
			txtLicencia_b.Text = " TERMS OF USE";
			txtLicencia_b.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			txtLicencia_b.SetTextSize(textFormat,Configuration.getHeight(25));
			txtLicencia_b.SetTextColor (Color.ParseColor ("#00c6ff"));
			chkLogin.Checked = false;

			chkLogin.SetBackgroundColor(Color.ParseColor("#ffffff"));

			imgLogo.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/logo.png"), Configuration.getWidth(360), Configuration.getHeight(230),true));
			btnLogin.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/login.png"), Configuration.getWidth(210), Configuration.getHeight(60),true));
			btnFacebook.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/signupface.png"), Configuration.getWidth(507), Configuration.getHeight(80),true));
			btnSingUp.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/signupnolisto.png"), Configuration.getWidth(507), Configuration.getHeight(80),true));

			Drawable dc = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/toregister.png"), Configuration.getWidth(47), Configuration.getHeight(47), true));
			chkLogin.SetBackgroundDrawable (dc);

			initButtonColor (btnLogin);
			initButtonColor (btnFacebook);
			initButtonColor (btnSingUp);
			linearLicencia.AddView (chkLogin);
			linearLicencia.AddView (txtLicencia_a);
			linearLicencia.AddView (txtLicencia_b);

			linearLogin.AddView (btnLogin);
			linearSingup.AddView (linearLicencia);
			linearSingup.AddView (btnSingUp);
			linearSingup.AddView (btnFacebook);

			linearLogo.AddView (imgLogo);

			linearLogo.SetX (0); linearLogo.SetY (Configuration.getHeight(373));
			linearContentText.SetX (0); linearContentText.SetY (Configuration.getHeight(557));
			linearLogin.SetX (0); linearLogin.SetY (Configuration.getHeight(30));
			linearSingup.SetX (0); linearSingup.SetY (Configuration.getHeight(785));

			relSingup.AddView (linearLogo);
			relSingup.AddView (linearContentText);
			relSingup.AddView (linearLogin);
			relSingup.AddView (linearSingup);
开发者ID:aocsa,项目名称:CInca,代码行数:67,代码来源:LoginView.cs

示例2: initUi_SignUp


//.........这里部分代码省略.........
			txtlogin_c1.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
			initText (txtlogin_c2, " for real", "#ffffff");
			txtlogin_c2.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			linearTxta.Orientation = Orientation.Horizontal;
			linearTxta.SetGravity (GravityFlags.Center);
			linearTxtb.Orientation = Orientation.Horizontal;
			linearTxtb.SetGravity (GravityFlags.Center);
			linearTxtc.Orientation = Orientation.Horizontal;
			linearTxtc.SetGravity (GravityFlags.Center);

			linearContentText.Orientation = Orientation.Vertical;
			linearContentText.SetGravity (GravityFlags.Center);

			linearTxta.AddView (txtlogin_a1); linearTxta.AddView (txtlogin_a2);
			linearTxtb.AddView (txtlogin_b1); linearTxtb.AddView (txtlogin_b2);
			linearTxtc.AddView (txtlogin_c1); linearTxtc.AddView (txtlogin_c2);

			linearContentText.AddView (linearTxta);
			linearContentText.AddView (linearTxtb);
			linearContentText.AddView (linearTxtc);

			var textFormat = Android.Util.ComplexUnitType.Px;

			txtLicencia_a.Text = "TO REGISTER, ACCEPT THE";
			txtLicencia_a.SetTextSize(textFormat,Configuration.getHeight(25));
			txtLicencia_a.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
			txtLicencia_a.SetTextColor (Color.ParseColor ("#ffffff"));
			txtLicencia_b.Text = " TERMS OF USE";
			txtLicencia_b.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			txtLicencia_b.SetTextSize(textFormat,Configuration.getHeight(25));
			txtLicencia_b.SetTextColor (Color.ParseColor ("#00c6ff"));
			chkLogin.Checked = false;

			chkLogin.SetBackgroundColor(Color.ParseColor("#ffffff"));

			imgLogo.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/logo.png"), Configuration.getWidth(317), Configuration.getHeight(70),true));
			btnLogin.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/login.png"), Configuration.getWidth(210), Configuration.getHeight(60),true));
			btnFacebook.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/signupface.png"), Configuration.getWidth(507), Configuration.getHeight(80),true));
			btnSingUp.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/signupnolisto.png"), Configuration.getWidth(507), Configuration.getHeight(80),true));

			Drawable dc = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/toregister.png"), Configuration.getWidth(47), Configuration.getHeight(47), true));
			chkLogin.SetBackgroundDrawable (dc);

			initButtonColor (btnLogin);
			initButtonColor (btnFacebook);
			initButtonColor (btnSingUp);
			linearLicencia.AddView (chkLogin);
			linearLicencia.AddView (txtLicencia_a);
			linearLicencia.AddView (txtLicencia_b);

			linearLogin.AddView (btnLogin);
			linearSingup.AddView (linearLicencia);
			linearSingup.AddView (btnSingUp);
			linearSingup.AddView (btnFacebook);

			linearLogo.AddView (imgLogo);

			linearLogo.SetX (0); linearLogo.SetY (Configuration.getHeight(447));
			linearContentText.SetX (0); linearContentText.SetY (Configuration.getHeight(557));
			linearLogin.SetX (0); linearLogin.SetY (Configuration.getHeight(30));
			linearSingup.SetX (0); linearSingup.SetY (Configuration.getHeight(785));

			relSingup.AddView (linearLogo);
			relSingup.AddView (linearContentText);
			relSingup.AddView (linearLogin);
			relSingup.AddView (linearSingup);
			mainLayout.AddView (relSingup);


			#region buttons_events

			btnLogin.Click+= BtnLogin_Click;

			btnSingUp.Click+= delegate {

				if(chkLogin.Checked==true){
					var com = ((LoginViewModel)this.DataContext).SignUpCommand;
					com.Execute(null);
				}
			} ;

			btnFacebook.Click += async delegate {
				await Authenticate(MobileServiceAuthenticationProvider.Facebook);
			} ;

			chkLogin.CheckedChange += delegate {
				if(chkLogin.Checked==true){
					btnSingUp.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/signuplisto.png"), Configuration.getWidth(507), Configuration.getHeight(80),true));
				}
				if(chkLogin.Checked==false){
					btnSingUp.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/signupnolisto.png"), Configuration.getWidth(507), Configuration.getHeight(80),true));
				}

			} ;
			#endregion


		}
开发者ID:aocsa,项目名称:eduticnow.droid,代码行数:101,代码来源:LoginView.cs


注:本文中的CheckBox.SetBackgroundColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。