コード例 #1
0
        private PopUp GetFeaturesPopUp()
        {
            var size  = new CGSize(300, 300);
            var popup = new PopUp(size);

            var closeButton = new UIButton(UIButtonType.System);

            closeButton.Frame = new CGRect(90, popup.Frame.Height - 60, 120, 60);

            closeButton.Font = Font;

            closeButton.SetTitle("Close", UIControlState.Normal);
            closeButton.SetTitleColor(UIColor.Red, UIControlState.Normal);

            closeButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                popup.Close();
            };

            var titleLabel = new UILabel()
            {
                Frame     = new CGRect(10, 10, 290, 50),
                Text      = "Hello in custom popups!",
                Font      = UIFont.FromName("Futura", 25),
                TextColor = UIColor.Blue
            };

            var descriptionLabel = new UILabel()
            {
                Frame     = new CGRect(10, 90, 290, 120),
                Text      = "All features and avaiblities are avaible on our Github",
                Font      = Font,
                TextColor = UIColor.Black
            };

            descriptionLabel.LineBreakMode = UILineBreakMode.TailTruncation;
            descriptionLabel.Lines         = 0;

            popup.AddSubview(titleLabel);
            popup.AddSubview(descriptionLabel);
            popup.AddSubview(closeButton);

            popup.OnOpen += () =>
            {
                Debug.WriteLine("[INFO] PopUp is here!");
            };

            return(popup);
        }