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


C# CheckBox.SetBackgroundDrawable方法代码示例

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


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

示例1: init

		public void init(){



			var textFormat = Android.Util.ComplexUnitType.Px;

			_dialog = new ProgressDialog(this);


			//popupBuilder.SetView(_dialog);


			_dialog.SetMessage("Espere por favor...");
			_dialog.SetCancelable(false);
			//_dialog.Show();

			mainLayout = new RelativeLayout (this);
			relSingup = new RelativeLayout (this);
			relLogin = new RelativeLayout (this);
			linearLicencia = new LinearLayout (this);
			linearLogin = new LinearLayout (this);
			linearSingup = new LinearLayout (this);
			linearLogo = new LinearLayout (this);

			imgLogo = new ImageView (this);
			btnLogin = new ImageButton (this);
			btnSingUp = new ImageButton (this);
			btnFacebook = new ImageButton (this);
			chkLogin = new CheckBox (this);
			txtLicencia_a = new TextView (this);
			txtLicencia_b = new TextView (this);

			txtlogin_a1 = new TextView (this);
			txtlogin_a2 = new TextView (this);
			txtlogin_b1 = new TextView (this);
			txtlogin_b2 = new TextView (this);
			txtlogin_c1 = new TextView (this);
			txtlogin_c2 = new TextView (this);

			initText (txtlogin_a1, "", "#00c6ff");
			txtlogin_a1.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			initText (txtlogin_a2, "", "#ffffff");
			txtlogin_a2.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			initText (txtlogin_b1, "", "#00c6ff");
			txtlogin_b1.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			initText (txtlogin_b2, "","#ffffff");
			txtlogin_b2.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			initText (txtlogin_c1, "", "#00c6ff");
			txtlogin_c1.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			initText (txtlogin_c2, "", "#ffffff");
			txtlogin_c2.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
		

			linearTxta = new LinearLayout (this);
			linearTxtb = new LinearLayout (this);
			linearTxtc = new LinearLayout (this);
			linearContentText = new LinearLayout (this);

			linearTxta.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			linearTxtb.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			linearTxtc.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			linearContentText.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);

			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);


			mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);
			Drawable d = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/afondo.png"), 768, 1024, true));
			mainLayout.SetBackgroundDrawable (d);

			relSingup.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
			relLogin.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);


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

//.........这里部分代码省略.........
开发者ID:aocsa,项目名称:CInca,代码行数:101,代码来源: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.SetBackgroundDrawable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。