page contents

C# ImageButton.SetX方法代码示例

本文讲述了C# ImageButton.SetX方法代码示例!具有很好的参考价值,希望对大家有所帮助。一起跟随六星小编过来看看吧,具体如下:

attachments-2022-08-AWsyZQg562f7051c42cd3.png

本文讲述了C# ImageButton.SetX方法代码示例!具有很好的参考价值,希望对大家有所帮助。一起跟随六星小编过来看看吧,具体如下:

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

示例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

更多相关技术内容咨询欢迎前往并持续关注六星社区了解详情。

想高效系统的学习Python编程语言,推荐大家关注一个微信公众号:Python编程学习圈。每天分享行业资讯、技术干货供大家阅读,关注即可免费领取整套Python入门到进阶的学习资料以及教程,感兴趣的小伙伴赶紧行动起来吧。

attachments-2022-05-rLS4AIF8628ee5f3b7e12.jpg

  • 发表于 2022-08-13 09:58
  • 阅读 ( 333 )
  • 分类:C/C++开发

你可能感兴趣的文章

相关问题

0 条评论

请先 登录 后评论
轩辕小不懂
轩辕小不懂

2403 篇文章

作家榜 »

  1. 轩辕小不懂 2403 文章
  2. 小柒 1312 文章
  3. Pack 1135 文章
  4. Nen 576 文章
  5. 王昭君 209 文章
  6. 文双 71 文章
  7. 小威 64 文章
  8. Cara 36 文章