Esempio n. 1
0
        public static UIButton SelectPhoto(UIViewController owner, UIImageView imagen)
        {
            UIButton btnPhoto = new STLButton("Seleccionar imagen");

            btnPhoto.TouchUpInside += (s, e) =>
            {
                UIImagePickerController imagePicker = new UIImagePickerController();
                new ImageGallery(imagePicker, imagen);
                owner.PresentViewController(imagePicker, true, () => { });
            };
            return(btnPhoto);
        }
Esempio n. 2
0
        /// <summary>
        /// Vista de la busqueda
        /// </summary>
        void SearchView()
        {
            UITextField txtNombre = new STLTextField("Nombre", 130);

            txtPais = new STLTextField("País", 190);
            txtPais.EditingDidBegin += (sender, e) =>
            {
                selectView = new UIDropdownList(txtPais, View);
            };
            txtPais.EditingDidEnd += (sender, e) =>
            {
                selectView.RemoveFromSuperview();
            };
            txtEstado = new STLTextField("Estado", 250);
            txtEstado.EditingDidBegin += (sender, e) =>
            {
                if (!string.IsNullOrEmpty(txtPais.Text))
                {
                    selectView = new UIDropdownList(txtEstado, View, txtPais.Text);
                }
            };
            txtEstado.EditingDidEnd += (sender, e) =>
            {
                if (!string.IsNullOrEmpty(txtPais.Text))
                {
                    selectView.RemoveFromSuperview();
                }
            };
            txtMunicipio = new STLTextField("Municipio", 310);
            txtMunicipio.EditingDidBegin += (sender, e) =>
            {
                if (!string.IsNullOrEmpty(txtEstado.Text))
                {
                    selectView = new UIDropdownList(txtMunicipio, View, txtEstado.Text);
                }
            };
            txtMunicipio.EditingDidEnd += (sender, e) =>
            {
                if (!string.IsNullOrEmpty(txtEstado.Text))
                {
                    selectView.RemoveFromSuperview();
                }
            };
            txtGiro = new STLTextField("Giro", 370);
            txtGiro.EditingDidBegin += (sender, e) =>
            {
                selectView = new UIDropdownList(txtGiro, View);
            };
            txtGiro.EditingDidEnd += (sender, e) =>
            {
                selectView.RemoveFromSuperview();
            };

            UIButton btnBuscar = new STLButton("Buscar")
            {
                Frame = new CGRect(20, 400, 100, 30)
            };

            btnBuscar.TouchUpInside += (sender, e) =>
            {
                position = 32;
                FillData(txtNombre.Text, txtPais.Text, txtEstado.Text, txtMunicipio.Text, txtGiro.Text);
                searchView.RemoveFromSuperview();
                selectView.RemoveFromSuperview();
            };

            UIButton btnClose = new STLButton(UIImage.FromBundle("ic_clear"))
            {
                Frame = new CGRect(UIScreen.MainScreen.Bounds.Width - 40, 70, 30, 30)
            };

            btnClose.Layer.CornerRadius = 15;
            btnClose.TouchUpInside     += (sender, e) =>
            {
                searchView.RemoveFromSuperview();
            };
            searchView = new UIScrollView(new CGRect(0, 0, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height))
            {
                btnClose,

                new STLLabel("Nombre", 100),
                txtNombre,

                new STLLabel("País", 160),
                txtPais,

                new STLLabel("Estado", 220),
                txtEstado,

                new STLLabel("Municipio", 280),
                txtMunicipio,

                new STLLabel("Giro", 340),
                txtGiro,

                btnBuscar
            };
            searchView.BackgroundColor = UIColor.White;

            searchView.ContentSize = new CGSize(UIScreen.MainScreen.Bounds.Width, 500);

            View.AddSubview(searchView);
        }
Esempio n. 3
0
        void SearchView()
        {
            UITextField txtNombre      = new STLTextField("Nombre", 30);
            UITextField txtApellidos   = new STLTextField("Apellidos", 90);
            UITextField txtPuesto      = new STLTextField("Puesto", 150);
            UITextField txtProfesion   = new STLTextField("Profesión", 210);
            UITextField txtHabilidades = new STLTextField("Habilidades", 270);
            UITextField txtPais        = new STLTextField("País", 330);

            txtPais.EditingDidBegin += (sender, e) =>
            {
                selectView = new UIDropdownList(txtPais, View);
            };
            txtPais.EditingDidEnd += (sender, e) =>
            {
                selectView.RemoveFromSuperview();
            };
            UITextField txtEstado = new STLTextField("Estado", 390);

            txtEstado.EditingDidBegin += (sender, e) =>
            {
                if (!string.IsNullOrEmpty(txtPais.Text))
                {
                    selectView = new UIDropdownList(txtEstado, View, txtPais.Text);
                }
            };
            txtEstado.EditingDidEnd += (sender, e) =>
            {
                if (!string.IsNullOrEmpty(txtPais.Text))
                {
                    selectView.RemoveFromSuperview();
                }
            };
            UITextField txtMunicipio = new STLTextField("Municipio", 450);

            txtMunicipio.EditingDidBegin += (sender, e) =>
            {
                if (!string.IsNullOrEmpty(txtEstado.Text))
                {
                    selectView = new UIDropdownList(txtMunicipio, View, txtEstado.Text);
                }
            };
            txtMunicipio.EditingDidEnd += (sender, e) =>
            {
                if (!string.IsNullOrEmpty(txtEstado.Text))
                {
                    selectView.RemoveFromSuperview();
                }
            };
            UITextField txtEmpresa       = new STLTextField("Empresa", 510);
            UICheckBox  cbDisponibilidad = new UICheckBox(20, 550, true);


            UIButton btnBuscar = new STLButton("Buscar")
            {
                Frame = new CGRect(20, 580, 100, 30)
            };

            btnBuscar.TouchUpInside += (sender, e) =>
            {
                position = 0;
                FillData(txtNombre.Text, txtApellidos.Text, txtPuesto.Text, txtProfesion.Text, txtHabilidades.Text, cbDisponibilidad.IsChecked, txtPais.Text, txtEstado.Text, txtMunicipio.Text);
                searchView.RemoveFromSuperview();
            };

            UIButton btnClose = new STLButton(UIImage.FromBundle("ic_clear"))
            {
                Frame = new CGRect(UIScreen.MainScreen.Bounds.Width - 40, 0, 30, 30)
            };

            btnClose.TouchUpInside += (sender, e) =>
            {
                searchView.RemoveFromSuperview();
            };
            searchView = new UIScrollView(new CGRect(0, 70, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height))
            {
                btnClose,

                new STLLabel("Nombre", 0),
                txtNombre,

                new STLLabel("Apellidos", 60),
                txtApellidos,

                new STLLabel("Puesto", 120),
                txtPuesto,

                new STLLabel("Profesión", 180),
                txtProfesion,

                new STLLabel("Habilidades", 240),
                txtHabilidades,

                new STLLabel("País", 300),
                txtPais,

                new STLLabel("Estado", 360),
                txtEstado,

                new STLLabel("Municipio", 420),
                txtMunicipio,

                new STLLabel("Empresa", 480),
                txtEmpresa,

                new STLLabel("Disponibilidad", 545)
                {
                    Frame = new CGRect(50, 545, UIScreen.MainScreen.Bounds.Width, 30)
                },
                cbDisponibilidad,

                btnBuscar
            };
            searchView.BackgroundColor = UIColor.White;

            searchView.ContentSize = new CGSize(UIScreen.MainScreen.Bounds.Width, 780);

            View.AddSubview(searchView);
        }