Exemplo n.º 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();


            JVMenuHelper.RemoveLayerFromView(ContainerView);

            // gradient background color
            var newGradient = (CAGradientLayer)CAGradientLayer.Create();

            newGradient.Frame = this.View.Frame;

            var firstColor  = JVMenuHelper.ColorWithHexString("EF4DB6");
            var secondColor = JVMenuHelper.ColorWithHexString("C643FC");

            newGradient.Colors = new CoreGraphics.CGColor[] { firstColor.CGColor, secondColor.CGColor };


            ContainerView.Layer.InsertSublayer(newGradient, 0);

            Image           = JVMenuHelper.ChangeImageColor(UIImage.FromBundle("ask_question-48"), UIColor.Black);
            ImageView.Image = Image;

            Label.Text = @"Help?";
        }
        /// <summary>
        /// ViewDidLoad
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.View.BackgroundColor = UIColor.Clear;

            this.View.AutoresizingMask  = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
            this.View.AutosizesSubviews = true;

            ContainerView = new UIView(this.View.Frame);
            ContainerView.AutoresizingMask  = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
            ContainerView.AutosizesSubviews = true;

            // gradient background color
            Gradient       = (CAGradientLayer)CAGradientLayer.Create();
            Gradient.Frame = this.View.Frame;

            var firstColor  = JVMenuHelper.ColorWithHexString("52EDC7");
            var secondColor = JVMenuHelper.ColorWithHexString("5AC8FB");

            Gradient.Colors = new CoreGraphics.CGColor[] { firstColor.CGColor, secondColor.CGColor };


            ContainerView.Layer.InsertSublayer(Gradient, 0);

            Image           = JVMenuHelper.ChangeImageColor(JVMenuPopoverConfig.SharedInstance.MenuImage, UIColor.Black);
            ImageView       = new UIImageView(new CGRect(this.View.Frame.Size.Width / 2 - this.Image.Size.Width / 2, this.View.Frame.Size.Height / 2 - 30, this.Image.Size.Width, this.Image.Size.Height));
            ImageView.Image = Image;

            ContainerView.Add(ImageView);

            Label               = new UILabel(new CGRect(this.View.Frame.Size.Width / 2 - 110, this.View.Frame.Size.Height / 2 - 20, 220, 60));
            Label.TextColor     = UIColor.Black.ColorWithAlpha(0.6f);
            Label.TextAlignment = UITextAlignment.Center;
            Label.Font          = UIFont.FromName("HelveticaNeue", 20);
            Label.TextColor     = UIColor.Black;
            Label.Text          = @"Home";

            ContainerView.Add(Label);

            this.View.Add(ContainerView);
        }
Exemplo n.º 3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            //build the shared menu
            var menuItem = new List <JVMenuItem>()
            {
                new JVMenuActionItem()
                {
                    //View exisiting view controller, will be reused everytime the item is selected
                    Icon    = UIImage.FromBundle(@"home-48"),
                    Title   = @"Home",
                    Command = () =>
                    {
                        var uiAlert = new UIAlertView("Menu Item Clicked", "Home", null, "OK", null);
                        uiAlert.Show();
                    },
                },
                new JVMenuActionItem()
                {
                    //New view controller, will be reused everytime the item is selected
                    Icon    = UIImage.FromBundle(@"about-48"),
                    Title   = @"About Us",
                    Command = () =>
                    {
                        var uiAlert = new UIAlertView("Menu Item Clicked", "About Us", null, "OK", null);
                        uiAlert.Show();
                    },
                },
                new JVMenuActionItem()
                {
                    //New view controller, will be reused everytime the item is selected
                    Icon    = UIImage.FromBundle(@"settings-48"),
                    Title   = @"Our Service",
                    Command = () =>
                    {
                        var uiAlert = new UIAlertView("Menu Item Clicked", "Our Service", null, "OK", null);
                        uiAlert.Show();
                    },
                },
                new JVMenuActionItem()
                {
                    //New view controller, will be reused everytime the item is selected
                    Icon    = UIImage.FromBundle(@"business_contact-48"),
                    Title   = @"Contact Us",
                    Command = () =>
                    {
                        var uiAlert = new UIAlertView("Menu Item Clicked", "Contact Us", null, "OK", null);
                        uiAlert.Show();
                    },
                },
                new JVMenuActionItem
                {
                    //New view controller, will be recreated afresh everytime the item is selected
                    Icon    = UIImage.FromBundle(@"ask_question-48"),
                    Title   = @"Help?",
                    Command = () =>
                    {
                        var uiAlert = new UIAlertView("Menu Item Clicked", "Help?", null, "OK", null);
                        uiAlert.Show();
                    },
                },
                new JVMenuActionItem()
                {
                    //Action is called, on the UI thread, everytime the item is selected
                    Icon    = UIImage.FromBundle(@"ask_question-48"),
                    Title   = @"Logout",
                    Command = () =>
                    {
                        var uiAlert = new UIAlertView("Menu Item Clicked", "You clicked logout", null, "OK", null);
                        uiAlert.Show();
                    },
                },
            };

            _menuController = new JVMenuPopoverViewController(menuItem);

            this.View.BackgroundColor = UIColor.Clear;

            ContainerView = new UIView(this.View.Frame);

            // gradient background color
            Gradient       = (CAGradientLayer)CAGradientLayer.Create();
            Gradient.Frame = this.View.Frame;

            var firstColor  = JVMenuHelper.ColorWithHexString("52EDC7");
            var secondColor = JVMenuHelper.ColorWithHexString("5AC8FB");

            Gradient.Colors = new CoreGraphics.CGColor[] { firstColor.CGColor, secondColor.CGColor };


            ContainerView.Layer.InsertSublayer(Gradient, 0);



            this.View.Add(ContainerView);
        }