public static FRDLivelyButton GenerateLiveButton(UIColor normal, UIColor highlighted, float width)
        {
            // button
            FRDLivelyButton button = new FRDLivelyButton(new CGRect(20, 12, 25, 20));

            button.SetStyle(FRDLivelyButtonStyle.CaretUp, false);

            var keys = new NSObject [] {
                new NSString("kFRDLivelyButtonColor"),
                new NSString("kFRDLivelyButtonHighlightedColor"),
                new NSString("kFRDLivelyButtonLineWidth")
            };
            var objects = new NSObject [] {
                normal,
                highlighted,
                new NSNumber(width)
            };

            button.Options = NSDictionary.FromObjectsAndKeys(objects, keys);
            return(button);
        }
Esempio n. 2
0
        public NoteHeader(CGRect frame) : base(frame)
        {
            this.BackgroundColor   = UIColor.White;
            this.Layer.BorderColor = eBriefingAppearance.Gray4.CGColor;
            this.Layer.BorderWidth = 1f;

            // collapseButton
            collapseButton       = eBriefingAppearance.GenerateLiveButton(eBriefingAppearance.BlueColor, eBriefingAppearance.GreenColor, 2f);
            collapseButton.Frame = new CGRect(20, 12, 25, 20);
            collapseButton.SetStyle(FRDLivelyButtonStyle.CaretUp, false);
            collapseButton.UserInteractionEnabled = false;
            this.AddSubview(collapseButton);

            // headerLabel
            headerLabel           = eBriefingAppearance.GenerateLabel(21, eBriefingAppearance.Gray1, true);
            headerLabel.Frame     = new CGRect(collapseButton.Frame.Right + 20, 0, frame.Width - 20, frame.Height);
            headerLabel.TextColor = eBriefingAppearance.Gray2;
            this.AddSubview(headerLabel);

            transButton                = UIButton.FromType(UIButtonType.Custom);
            transButton.Frame          = new CGRect(0, 0, this.Frame.Width, this.Frame.Height);
            transButton.TouchUpInside += HandleTouchUpInside;
            this.AddSubview(transButton);
        }