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


C# ImageButton.SetY方法代码示例

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


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

示例1: setItemLogin


//.........这里部分代码省略.........



			etxtUser.Hint = "  Usuario"; 
			etxtUser.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			etxtPassword.Hint = "  Contraseña";
			etxtPassword.InputType = Android.Text.InputTypes.TextVariationPassword | Android.Text.InputTypes.ClassText;
			etxtPassword.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
			etxtPassword.InputType = InputTypes.TextVariationVisiblePassword;

			txtLogin_a.Text = "FORGOT PASSWORD?";
			txtLogin_a.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			txtLogin_b.Text = "            CHANGE";
			txtLogin_b.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			txtLogin_a.SetTextSize (txtFormat,Configuration.getHeight(30));
			txtLogin_b.SetTextSize (txtFormat, Configuration.getHeight (30));


			txtInicioSesion.Text = "Iniciar Sesión";
			txtInicioSesion.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
			txtInicioSesion.SetTextColor (Color.ParseColor("#ffffff"));
			txtInicioSesion.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (36));

			btnLoginInto.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/otherlogin.png"),Configuration.getWidth (242), Configuration.getHeight (78),true));
			etxtUser.SetTextColor (Color.ParseColor ("#ffffff"));
			etxtPassword.SetTextColor (Color.ParseColor ("#ffffff"));



			btnLoginInto.Click += delegate {
				_dialog.Show();
				var com = ((LoginViewModel)this.DataContext).LoginCommand;
				com.Execute(null);
				//AlertDialog.Builder popupBuilder = new AlertDialog.Builder(this);




			};

			initButtonColor (btnLoginInto);

			etxtPassword.InputType = InputTypes.TextVariationVisiblePassword;
			etxtPassword.TransformationMethod = Android.Text.Method.PasswordTransformationMethod.Instance;

			txtLogin_a.SetTextColor (Color.ParseColor ("#ffffff"));
			txtLogin_b.SetTextColor (Color.ParseColor ("#00c6ff"));


			Drawable drawableEditText = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/cajatexto.png"), Configuration.getWidth(507), Configuration.getHeight(80), true));
			etxtUser.SetBackgroundDrawable (drawableEditText);
			etxtPassword.SetBackgroundDrawable (drawableEditText);

			etxtUser.SetSingleLine (true);
			etxtPassword.SetSingleLine (true);

			LinearLayout space = new LinearLayout (this);
			space.LayoutParameters = new LinearLayout.LayoutParams (-1, 20);


			linearTextLogin.AddView (txtLogin_a);

			linearTextLogin.AddView (txtLogin_b);

			//linearButtonLogin.AddView (btnLoginInto);
			//linearButtonLogin.AddView (linearTextLogin);

			linearEditTextLogin.AddView (etxtUser);
			linearEditTextLogin.AddView (space);
			linearEditTextLogin.AddView (etxtPassword);


			txtInicioSesion.SetX (Configuration.getWidth(75)); txtInicioSesion.SetY (Configuration.getHeight(680));
			linearEditTextLogin.SetX (0); linearEditTextLogin.SetY (Configuration.getHeight(741));
			//linearButtonLogin.SetX (0); linearButtonLogin.SetY (Configuration.getHeight(978));


			btnLoginInto.SetX (Configuration.getWidth (45));btnLoginInto.SetY (Configuration.getHeight (980));
			linearTextLogin.SetX (Configuration.getWidth (345));linearTextLogin.SetY (Configuration.getHeight(995));

			relLogin.AddView (txtInicioSesion);
			relLogin.AddView (linearEditTextLogin);
			//relLogin.AddView (linearButtonLogin);
			relLogin.AddView(btnLoginInto);
			relLogin.AddView (linearTextLogin);

			((LoginViewModel)this.ViewModel).PropertyChanged += Login_propertyChanged;;



			var set = this.CreateBindingSet<LoginView, LoginViewModel>();
			set.Bind(etxtUser).To(vm => vm.Username);
			set.Bind(etxtPassword).To(vm => vm.Password);
			set.Apply(); 

			mainLayout.AddView (relLogin);
		}
开发者ID:aocsa,项目名称:CInca,代码行数:101,代码来源:LoginView.cs

示例2: 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); 

			}

//.........这里部分代码省略.........
开发者ID:aocsa,项目名称:eduticnow.droid,代码行数:101,代码来源:CameraView.cs


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