Esempio n. 1
0
        public void Initialize()
        {
            if (init)
            {
                return;
            }

            init = true;

            X = C.X_MID - 128;
            Y = 64;

            Frame             = new CGRect(X, Y, 256, C.Y_MAX - 128);
            BackgroundColor   = UIColor.Gray;
            Layer.BorderWidth = 3;
            Layer.BorderColor = UIColor.White.CGColor;

            AvatarView       = new UIButton();
            AvatarView.Frame = new CGRect(8, 32, 64, 64);
            AvatarView.SetImage(ViewController.Client.Image, UIControlState.Normal);
            AvatarView.AddTarget(ViewController.BtnHandler, new Selector("SelectAvatar"), UIControlEvent.TouchUpInside);
            AvatarView.ContentMode = UIViewContentMode.ScaleAspectFit;

            Title                 = new UITextView();
            Title.Frame           = new CGRect(64, 0, 128, 64);
            Title.BackgroundColor = UIColor.Clear;
            Title.Text            = "Settings";
            Title.Font            = Fonts.Settings_Title;
            Title.TextAlignment   = UITextAlignment.Center;

            Header = new UIView();
            Header.BackgroundColor = UIColor.Red;
            Header.Frame           = new CGRect(0, 0, Frame.Width, 32);

            TypeView       = new UIToggle("Option1", "Option2");
            TypeView.Frame = new CGRect(0, Frame.Width - 138, 240, 128);
            TypeView.Initialize();
            TypeView.SetImages(new UIImage[] { UIImage.FromBundle("settings_0"), UIImage.FromBundle("settings_1") });

            JoinClassView       = new UIButton();
            JoinClassView.Frame = new CGRect(0, Frame.Height - 186, 240, 128);
            JoinClassView.SetImage(UIImage.FromBundle("button_joinroom"), UIControlState.Normal);
            JoinClassView.ImageView.ContentMode = UIViewContentMode.ScaleAspectFit;
            JoinClassView.AddTarget(this, new Selector("ShowJoinRoom"), UIControlEvent.TouchUpInside);

            Username                 = new UITextView();
            Username.Text            = ViewController.Client.Username;
            Username.Frame           = new CGRect(80, 24, 128, 32);
            Username.BackgroundColor = UIColor.Clear;
            Username.Font            = Fonts.Medium;

            Bio                 = new UITextView();
            Bio.Text            = ViewController.Client.Bio;
            Bio.Frame           = new CGRect(48, 48, 192, 64);
            Bio.BackgroundColor = UIColor.Clear;
            Bio.Font            = Fonts.Small;
            Bio.TextAlignment   = UITextAlignment.Center;

            Cancel       = new UIButton();
            Cancel.Frame = new CGRect(Frame.Width - 32, 0, 32, 32);
            Cancel.SetImage(UIImage.FromBundle("button_cancel"), UIControlState.Normal);
            Cancel.ContentMode = UIViewContentMode.ScaleAspectFit;
            Cancel.AddTarget(this, new Selector("Cancel"), UIControlEvent.TouchUpInside);
        }