예제 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            AutomaticallyAdjustsScrollViewInsets = false;
            EdgesForExtendedLayout = UIRectEdge.All;

            UIKeyboard.Notifications.ObserveWillShow(KeyboardWillShow);
            UIKeyboard.Notifications.ObserveWillHide(KeyboardWillHide);
            UIDevice.Notifications.ObserveOrientationDidChange(OrientationDidChange);

            Title = "CRToast";
            UpdateDurationLabel();
            var font = UIFont.BoldSystemFontOfSize(10);

            SegFromDirection.SetTitleTextAttributes(new UITextAttributes()
            {
                Font = font
            }, UIControlState.Normal);
            SegToDirection.SetTitleTextAttributes(new UITextAttributes()
            {
                Font = font
            }, UIControlState.Normal);
            InAnimationTypeSegmentedControl.SetTitleTextAttributes(new UITextAttributes()
            {
                Font = font
            }, UIControlState.Normal);
            OutAnimationTypeSegmentedControl.SetTitleTextAttributes(new UITextAttributes()
            {
                Font = font
            }, UIControlState.Normal);


            TxtSubtitleMessage.ShouldReturn = TextFieldShouldReturn;
            TxtSubtitleMessage.ShouldReturn = TextFieldShouldReturn;


            var tapGestureRecognizer = new UITapGestureRecognizer(ScrollViewTapped);

            ScrollView.AddGestureRecognizer(tapGestureRecognizer);

            AddHandlers();
            UpdateImageTintSwitch();
        }