當前位置: 首頁>>代碼示例>>C#>>正文


C# EntryElement.BecomeFirstResponder方法代碼示例

本文整理匯總了C#中MonoTouch.Dialog.EntryElement.BecomeFirstResponder方法的典型用法代碼示例。如果您正苦於以下問題:C# EntryElement.BecomeFirstResponder方法的具體用法?C# EntryElement.BecomeFirstResponder怎麽用?C# EntryElement.BecomeFirstResponder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MonoTouch.Dialog.EntryElement的用法示例。


在下文中一共展示了EntryElement.BecomeFirstResponder方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateRootElement

        private RootElement CreateRootElement()
        {
            var captionLabel = UIHelper.CreateLabel (
                "cross copy",
                true,
                32,
                32,
                UITextAlignment.Center,
                UIColor.Black
                );
            UILabel subcaptionLabel = UIHelper.CreateLabel (
                WELCOME_LABEL_TEXT,
                false,
                14,
                85,
                UITextAlignment.Center,
                lightTextColor
                );
            subcaptionLabel.Tag = 3;

            captionLabel.Frame = new Rectangle (0, 10, 320, 40);
            subcaptionLabel.Frame = new Rectangle (20, 55, 280, 100);
            UIView header = new UIView (new Rectangle (0, 0, 300, 145));
            header.AddSubviews (captionLabel, subcaptionLabel);

            var root = new RootElement ("Secrets")
            {
                new Section (header),
                (secretsSection = new Section ("Secrets")),
                new Section ()
                {
                    (secretEntry = new AdvancedEntryElement ("Secret", "enter new phrase", "", null))
                }
            };

            secretsSection.AddAll (from s in AppDelegate.HistoryData.Secrets select (Element)CreateImageButtonStringElement (s));

            secretEntry.AutocapitalizationType = UITextAutocapitalizationType.None;
            secretEntry.ShouldReturn += delegate {

                if (String.IsNullOrEmpty (secretEntry.Value))
                    return false;

                var newSecret = new Secret (secretEntry.Value);
                AppDelegate.HistoryData.Secrets.Add (newSecret);

                if (root.Count == 2)
                    root.Insert (1, secretsSection);

                secretsSection.Insert (
                    secretsSection.Elements.Count,
                    UITableViewRowAnimation.Fade,
                    CreateImageButtonStringElement (newSecret)
                    );
                secretEntry.Value = "";
                secretEntry.ResignFirstResponder (false);
                DisplaySecretDetail (newSecret);

                return true;
            };
            secretEntry.ReturnKeyType = UIReturnKeyType.Go;
            if (secretsSection.Count == 0) {
                secretEntry.BecomeFirstResponder (true);
                root.RemoveAt (1);
            }
            return root;
        }
開發者ID:bshehera,項目名稱:cross-copy,代碼行數:67,代碼來源:AppDelegate.cs

示例2: InstapaperSignInController

                public InstapaperSignInController(InstapaperBookmark instapaper, Action<bool> callback)
                {
                    this.instapaper = instapaper;
                    this.callback = callback;

                    var root = new RootElement ("Instapaper") {
                        new Section ("", "Get your account at instapaper.com"){
                            (userElement = new EntryElement ("Username", "or email address", instapaper.username)),
                            (passwordElement = new EntryElement ("Password", "", instapaper.password, true))
                        }
                    };
                    dvc = new DialogViewController (UITableViewStyle.Grouped, root, true);
                    dvc.NavigationItem.SetLeftBarButtonItem (new UIBarButtonItem (Locale.GetText ("Close"), UIBarButtonItemStyle.Plain, delegate { Close (false);}), false);
                    dvc.NavigationItem.RightBarButtonItem = new UIBarButtonItem (Locale.GetText ("Save"), UIBarButtonItemStyle.Plain, delegate { Save (); });

                    SetViewControllers (new UIViewController [] { dvc }, false);

                    userElement.BecomeFirstResponder (false);
                }
開發者ID:sdether,項目名稱:TweetStation,代碼行數:19,代碼來源:Instapaper.cs


注:本文中的MonoTouch.Dialog.EntryElement.BecomeFirstResponder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。