Exemplo n.º 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var width = (float)UIScreen.MainScreen.Bounds.Width;

            ScrollViewContact.Frame         = new RectangleF(0f, 0f, width, 46.0f);
            ScrollViewContact.ScrollEnabled = true;
            ScrollViewContact.ShowsVerticalScrollIndicator   = false;
            ScrollViewContact.ShowsHorizontalScrollIndicator = true;
            ScrollViewContact.ContentSize = new CGSize(width, 46.0f);
            SaveButton.Enabled            = false;

            var toolbar = new UIToolbar();

            toolbar.BarStyle    = UIBarStyle.Default;
            toolbar.Translucent = true;
            toolbar.SizeToFit();

            var doneButton = new UIBarButtonItem(Application.LocalizedString("Validate"), UIBarButtonItemStyle.Done, (s, e) =>
            {
                AlertMessageTextField.ResignFirstResponder();
            });

            toolbar.SetItems(new UIBarButtonItem[] { doneButton }, true);
            AlertMessageTextField.InputAccessoryView         = toolbar;
            AddRecipientButton.TouchUpInside                += AddRecipientButton_TouchUpInside;
            AddRecipientFromContactBookButton.TouchUpInside += AddRecipientFromContactButton_TouchUpInside;
            SaveButton.TouchUpInside += SaveButton_TouchUpInside;
            App.Locator.AlertSOS.OnAlertSosChanged += AlertSOS_OnAlertSosChanged;
            EmptyDataButton.AddGestureRecognizer(new UITapGestureRecognizer(EmptyDataButton_TouchUpInside));

            // Keyboard popup
            _observer1 = NSNotificationCenter.DefaultCenter.AddObserver
                             (UIKeyboard.DidShowNotification, KeyBoardUpNotification);

            // Keyboard Down
            _observer2 = NSNotificationCenter.DefaultCenter.AddObserver
                             (UIKeyboard.WillHideNotification, KeyBoardDownNotification);
        }
Exemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var width = (float)UIScreen.MainScreen.Bounds.Width;

            ScrollViewContact.Frame         = new RectangleF(0f, 0f, width, 46.0f);
            ScrollViewContact.ScrollEnabled = true;
            ScrollViewContact.ShowsVerticalScrollIndicator   = false;
            ScrollViewContact.ShowsHorizontalScrollIndicator = true;
            ScrollViewContact.ContentSize = new CGSize(width, 46.0f);

            var toolbar = new UIToolbar();

            toolbar.BarStyle    = UIBarStyle.Default;
            toolbar.Translucent = true;
            toolbar.SizeToFit();

            var doneButton = new UIBarButtonItem(Application.LocalizedString("Validate"), UIBarButtonItemStyle.Done, (s, e) =>
            {
                foreach (var view in View.Subviews)
                {
                    if (view.IsFirstResponder)
                    {
                        AlertMessageTextField.ResignFirstResponder();
                    }
                }
            });

            toolbar.SetItems(new UIBarButtonItem[] { doneButton }, true);
            AlertMessageTextField.InputAccessoryView         = toolbar;
            AddRecipientButton.TouchUpInside                += AddRecipientButton_TouchUpInside;
            AddRecipientFromContactBookButton.TouchUpInside += AddRecipientFromContactButton_TouchUpInside;
            EmptyDataButton.AddGestureRecognizer(new UITapGestureRecognizer(EmptyDataButton_TouchUpInside));
            NavigationItem.SetRightBarButtonItem(
                new UIBarButtonItem(Application.LocalizedString("OK"), UIBarButtonItemStyle.Bordered
                                    , (sender, args) => { SaveBarButton_Clicked(); })
                , true);
        }