public static void CreateAccessoryInputView(this UITextView @this, IEnumerable<UIButton> buttons)
        {
            var normalButtonImage = ImageFromColor(UIColor.White);
            var pressedButtonImage = ImageFromColor(UIColor.FromWhiteAlpha(0.0f, 0.4f));

            foreach (var button in buttons)
            {
                button.SetBackgroundImage(normalButtonImage, UIControlState.Normal);
                button.SetBackgroundImage(pressedButtonImage, UIControlState.Highlighted);
            }

            var height = CalculateHeight(UIApplication.SharedApplication.StatusBarOrientation);
            var s = new ScrollingToolbarView(new CGRect(0, 0, @this.Bounds.Width, height), buttons);
            s.BackgroundColor = UIColor.FromRGB(212, 214, 219);
            @this.InputAccessoryView = s;
        }
Exemple #2
0
        public ButtonAccessoryView(IEnumerable <UIButton> buttons)
        {
            var normalButtonImage  = ImageFromColor(UIColor.White);
            var pressedButtonImage = ImageFromColor(UIColor.FromWhiteAlpha(0.0f, 0.4f));

            foreach (var button in buttons)
            {
                button.SetBackgroundImage(normalButtonImage, UIControlState.Normal);
                button.SetBackgroundImage(pressedButtonImage, UIControlState.Highlighted);
            }

            _scrollingToolBar = new ScrollingToolbarView(new CGRect(0, 0, Bounds.Width, Bounds.Height), buttons);
            _scrollingToolBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            _scrollingToolBar.BackgroundColor  = UIColor.FromWhiteAlpha(0.84f, 1.0f);
            Add(_scrollingToolBar);
        }
        public ButtonAccessoryView(IEnumerable<UIButton> buttons)
        {
            Frame = new CGRect(0, 0, 320f, 44f);

            var normalButtonImage = ImageFromColor(UIColor.White);
            var pressedButtonImage = ImageFromColor(UIColor.FromWhiteAlpha(0.0f, 0.4f));

            foreach (var button in buttons)
            {
                button.SetBackgroundImage(normalButtonImage, UIControlState.Normal);
                button.SetBackgroundImage(pressedButtonImage, UIControlState.Highlighted);
            }

            _scrollingToolBar = new ScrollingToolbarView(new CGRect(0, 0, Bounds.Width, Bounds.Height), buttons);
            _scrollingToolBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            _scrollingToolBar.BackgroundColor = UIColor.FromWhiteAlpha(0.84f, 1.0f);
            Add(_scrollingToolBar);
        }