示例#1
0
        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;
        }
示例#2
0
 public static NativeColor Gray(int g) => NativeColor.FromWhiteAlpha(g / ((nfloat)255), 1);