当前位置: 首页>>代码示例>>C#>>正文


C# UISearchBar.ResignFirstResponder方法代码示例

本文整理汇总了C#中UISearchBar.ResignFirstResponder方法的典型用法代码示例。如果您正苦于以下问题:C# UISearchBar.ResignFirstResponder方法的具体用法?C# UISearchBar.ResignFirstResponder怎么用?C# UISearchBar.ResignFirstResponder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UISearchBar的用法示例。


在下文中一共展示了UISearchBar.ResignFirstResponder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CustomSearchController

		public CustomSearchController (ViewController owner, UISearchBar searchBar, UITableView searchPredictionTable, List<Room> rooms)
		{
			_searchBar = searchBar;
			_searchPredictionTable = searchPredictionTable;
			owner.InvokeOnMainThread (delegate() {
				_searchPredictionTable.Alpha = 0;
			});

			tableSource = new TableSource (owner, rooms);
			_searchPredictionTable.Source = tableSource;

			_searchBar.TextChanged += (sender, e) => {
				owner.InvokeOnMainThread (delegate() {
                    tableSource.tableItems = rooms.FindAll ((room) => room.Name.ToLower().Contains (e.SearchText.ToLower())).ToArray ();
					_searchPredictionTable.ReloadData();
				});
			};

			_searchBar.CancelButtonClicked += (sender, e) => {
				_searchBar.ShowsCancelButton = false;
				_searchBar.ResignFirstResponder();
			};

			_searchBar.OnEditingStarted += (sender, e) => {
				_searchBar.ShowsCancelButton = true;
				_searchPredictionTable.Alpha = 1;
			};
            _searchBar.OnEditingStopped += (sender, e) => {
                _searchPredictionTable.Alpha = 0;
                _searchBar.ResignFirstResponder ();

            };

		}
开发者ID:dcbright01,项目名称:Navigator,代码行数:34,代码来源:CustomSearchController.cs

示例2: CancelButtonClicked

 public override void CancelButtonClicked (UISearchBar searchBar)
 {
     searchBar.ShowsCancelButton = false;
     searchBar.ResignFirstResponder ();
     searchBar.Text = string.Empty;
     _searchTextChanging.OnNext(searchBar.Text);
 }
开发者ID:runt18,项目名称:CodeHub,代码行数:7,代码来源:ObservableSearchDelegate.cs

示例3: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            LoadWords ();

            Background back = new Background();
            View.Add(back.View);
            View.SendSubviewToBack (back.View);

            RectangleF resultsRect = new RectangleF (0, 75, View.Bounds.Width, View.Bounds.Height - 75);
            resultsTable = new UITableView (resultsRect);
            resultsTable.BackgroundColor = UIColor.Clear;
            Add (resultsTable);
            searchBar = new UISearchBar (new RectangleF(0, 0, View.Bounds.Width, 40));
            searchBar.Text = this.initialSearch;
            Add (searchBar);

            tableSource = new WordsTableSource(this);
            resultsTable.Source = tableSource;

            searchBar.SearchButtonClicked += (s, e) => searchBar.ResignFirstResponder ();

            // refine the search results every time the text changes
            searchBar.TextChanged += (s, e) => RefineSearchItems ();

            RefineSearchItems ();
        }
开发者ID:KuroiAme,项目名称:Indexer,代码行数:28,代码来源:SearchScreen.cs

示例4: CancelButtonClicked

		public override void CancelButtonClicked(UISearchBar searchbar)
		{
			searchbar.ShowsCancelButton = false;
			searchbar.ResignFirstResponder();
			new Wait(new TimeSpan(0,0,0,0,300), ()=> 
			{
				_Container.FinishSearch(false); 
				_Container.ToggleSearchbar();
			});
		}
开发者ID:vknair74,项目名称:MonoMobile.Views,代码行数:10,代码来源:DialogViewSearchDelegate.cs

示例5: BuildInterface

        public void BuildInterface()
        {
            Root = new RootElement (S.GetText (S.MATTER_SEARCH));
            var rect = new RectangleF (100, 200, 400, 50);
            SearchBar = new UISearchBar (rect);

            var searchSec = new Section (SearchBar);
            resultSection = new Section ("Matter Search Results");

            Root.Add (searchSec);
            Root.Add (resultSection);

            SearchBar.SearchButtonClicked += delegate {
                SearchBar.ResignFirstResponder ();
                if (isBusy) {
                    new UIAlertView ("Search", "Searching is continuing, cannot start new search", null, "OK").Show ();
                    cnt++;
                    if (cnt > 1) {
                        isBusy = false;
                        cnt = 0;
                    }
                    return;
                }
                string s = SearchBar.Text.Trim ();
                if (s == "" || s.Length == 0) {
                    new UIAlertView ("Search", "Please enter search text", null, "OK").Show ();
                    return;
                } else {
                    getAsyncData ();
                }
            };

            SearchBar.BookmarkButtonClicked += delegate {
                SearchBar.ResignFirstResponder ();
            };
            SearchBar.CancelButtonClicked += delegate {
                SearchBar.ResignFirstResponder ();
            };

            string srch = NSUserDefaults.StandardUserDefaults.StringForKey ("search");
            if (srch != null && srch != "") {
                SearchBar.Text = srch;
                getAsyncData ();
            }
        }
开发者ID:rajeshwarn,项目名称:GhostPractice-iPadRepo,代码行数:45,代码来源:Finder.cs

示例6: ViewDidLoad

        public override void ViewDidLoad()
        {
            Title = "Home";
            dvc = new DialogViewController(CreateRootElement(), true);
            dvc.View.Frame = new System.Drawing.RectangleF(0, 44, View.Frame.Width, View.Frame.Height);
            View.Add(dvc.View);

            _search = new UISearchBar(new RectangleF(0, 0, View.Frame.Width, 44));

            _search.SearchButtonClicked += delegate {
                if (string.IsNullOrEmpty (_search.Text)) return;

                _search.ResignFirstResponder ();

                _next = new MoviesController(MovieType.Search, null, _search.Text);
                NavigationController.PushViewController(_next, true);
            };

            View.Add(_search);
        }
开发者ID:jivkopetiov,项目名称:MoviesApp,代码行数:20,代码来源:HomeController.cs

示例7: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            EdgesForExtendedLayout = UIRectEdge.None;
            _source = new TableSource (ViewModel.Markets, this);
            TableView.Source = _source;

            _searchBar = new UISearchBar ();
            _searchBar.Placeholder = "Enter Zip Code";
            _searchBar.SizeToFit ();
            _searchBar.SearchButtonClicked += async delegate(object sender, EventArgs e) {
                UIApplication.SharedApplication.NetworkActivityIndicatorVisible = true;
                await ViewModel.SearchMarkets(_searchBar.Text);
                _source.Items = ViewModel.Markets;
                TableView.ReloadData();
                _searchBar.ResignFirstResponder();
                UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false;
            };

            TableView.TableHeaderView = _searchBar;
        }
开发者ID:james-alt,项目名称:FarmersMarket,代码行数:22,代码来源:MainViewController.cs

示例8: PodcastsController

    public PodcastsController(UICollectionViewLayout layout)
      : base(layout)
    {

      searchBar = new UISearchBar
      {
        Placeholder = "Search for a podcast",
        AutocorrectionType = UITextAutocorrectionType.No,
        AutocapitalizationType = UITextAutocapitalizationType.None,
        AutoresizingMask = UIViewAutoresizing.All,
        Alpha = 0.4f
      };

      searchBar.SizeToFit();

      searchBar.SearchButtonClicked += (sender, e) =>
      {
        Search(searchBar.Text);
        searchBar.ResignFirstResponder();
      };

      searchBar.TextChanged += (sender, e) => Search(e.SearchText);
    }
开发者ID:rampyodm,项目名称:XamarinDNR,代码行数:23,代码来源:PodcastsController.cs

示例9: CancelButtonClicked

 public override void CancelButtonClicked(UISearchBar searchBar)
 {
     searchBar.ShowsCancelButton = false;
     _container.FinishSearch ();
     searchBar.ResignFirstResponder ();
     _container.NavigationController.SetNavigationBarHidden(false, true);
     _container.SearchEnd();
 }
开发者ID:steffen-avemarg,项目名称:CodeBucket,代码行数:8,代码来源:ExploreController.cs

示例10: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();
            this.View.Layer.Frame = new CoreGraphics.CGRect (0, 0, uvWidth, uvheight);
            mutListView = new UITableView (new CoreGraphics.CGRect (0, 88, uvWidth, uvheight-100));
            mutListView.AllowsMultipleSelection = AllowsMultipleSelection;
            mutListView.AllowsMultipleSelectionDuringEditing = AllowsMultipleSelection;
            NavBar=new UINavigationBar(new CoreGraphics.CGRect (0, 0, uvWidth, 44));
            //			UIBarButtonItem bbitemCancel = new UIBarButtonItem (UIBarButtonSystemItem.Cancel, CancelButtonClicked);
            UIButton btnCancel = new UIButton (new CGRect (0, 0, 80, 30));
            btnCancel.SetTitleColor (UIColor.Blue, UIControlState.Normal);
            btnCancel.SetTitle ("Cancel", UIControlState.Normal);
            btnCancel.TouchUpInside += (object sender, EventArgs e) => {
                popover.Dismiss(false);
            };
            UIBarButtonItem bbitemCancel = new UIBarButtonItem (btnCancel);

            //			UIBarButtonItem bbitemDone = new UIBarButtonItem (UIBarButtonSystemItem.Done, DoneButtonClicked);
            UIButton btnDone = new UIButton (new CGRect (0, 0, 80, 30));
            btnDone.SetTitleColor (UIColor.Blue, UIControlState.Normal);
            btnDone.SetTitle ("Done", UIControlState.Normal);
            btnDone.TouchUpInside += (object sender, EventArgs e) => {
                DismissPopOver();
            };
            UIBarButtonItem bbitemDone = new UIBarButtonItem (btnDone);

            UINavigationItem navgitem = new UINavigationItem ("Select");
            navgitem.SetLeftBarButtonItem(bbitemCancel,true);
            navgitem.SetRightBarButtonItem (bbitemDone, true);
            NavBar.PushNavigationItem(navgitem,true);
            searchBar=new UISearchBar(new CoreGraphics.CGRect (0, 44, uvWidth, 44));
            this.View.Add (NavBar);
            this.View.AddSubview(mutListView);
            this.View.AddSubview(searchBar);
            this.mutListView.Source =new mCodePickerSource(this);
            //mutListView.SetContentOffset (new CoreGraphics.CGPoint (0, mutListView.ContentSize.Height - mutListView.Frame.Size.Height), false);
            //CoreGraphics.CGRect fram = mutListView.Frame;
            //fram.Height = mutListView.ContentSize.Height;
            //	mutListView.Frame = fram;
            this.searchBar.TextChanged += (object sender, UISearchBarTextChangedEventArgs e) =>
            {
                //DataSource.Clear();
                DataSource=tempds.FindAll(u=>u.ItemText.ToLower().Contains(searchBar.Text.ToLower()));
                this.mutListView.Source =new mCodePickerSource(this);
                this.mutListView.ReloadData();
                searchBar.ShowsCancelButton = true;

            };

            this.searchBar.CancelButtonClicked += (object sender, EventArgs e) => {
                searchBar.Text=string.Empty;
                DataSource=tempds;
                searchBar.ResignFirstResponder();
                searchBar.ShowsCancelButton = false;
                this.mutListView.ReloadData();
            };
            //lbltitle.Title = "Select";
            //btnDone.Clicked+= (object sender, EventArgs e) => {
            //	DismissPopOver();
            //};
            //BtnCancel.Clicked+= (object sender, EventArgs e) => {
            //
            //};
            //mTrashBtn.Clicked+= (object sender, EventArgs e) => {
                //if(popover!=null)
                //	popover.Dismiss(false);
            //};
            // Perform any additional setup after loading the view, typically from a nib.
        }
开发者ID:Nahidahmed,项目名称:iProPQRS,代码行数:69,代码来源:mCodePicker.cs

示例11: SetUpSearchDelegates

        protected virtual void SetUpSearchDelegates(UISearchBar searchBar)
        {
            searchBar.OnEditingStarted += (sender, e) =>
            {
                searchBar.ShowsCancelButton = true;
                this.StartSearch();
            };

            searchBar.OnEditingStopped += (sender, e) => 
            {
                searchBar.ShowsCancelButton = false;
            };

            searchBar.TextChanged += (sender, e) => PerformFilter(e.SearchText ?? string.Empty);

            searchBar.CancelButtonClicked += (sender, e) => 
            {
                searchBar.ShowsCancelButton = false;
                searchBar.Text = string.Empty;
                FinishSearch();
                searchBar.ResignFirstResponder();
            };

            searchBar.SearchButtonClicked += (sender, e) => {
                SearchButtonClicked(searchBar.Text);
            };
        }
开发者ID:Jeff-Lewis,项目名称:CodeBucket,代码行数:27,代码来源:DialogViewController.cs

示例12: SearchButtonClicked

			public override void SearchButtonClicked (UISearchBar bar)
			{
				bar.ResignFirstResponder ();
				
				if(!string.IsNullOrEmpty(bar.Text))
				   if(OnSearch != null)
						OnSearch(this,new EventArgs());
				   		
			}
开发者ID:SuperYeti,项目名称:MonoTouch.Dialog.Extensions,代码行数:9,代码来源:Main.cs

示例13: CancelButtonClicked

			public override void CancelButtonClicked (UISearchBar bar)
			{
				bar.ResignFirstResponder ();
			}
开发者ID:SuperYeti,项目名称:MonoTouch.Dialog.Extensions,代码行数:4,代码来源:Main.cs

示例14: CancelButtonClicked

			public override void CancelButtonClicked (UISearchBar searchBar)
			{
				searchBar.ShowsCancelButton = false;
				container.FinishSearch ();
				searchBar.ResignFirstResponder ();
			}
开发者ID:chrisbranson,项目名称:MonoTouch.Dialog,代码行数:6,代码来源:DialogViewController.cs

示例15: CancelButtonClicked

 public override void CancelButtonClicked (UISearchBar searchBar)
 {
     var r = container.Get();
     searchBar.ShowsCancelButton = false;
     if (r != null)
     {
         r._searchBar.Text = "";
         r.FinishSearch();
     }
     searchBar.ResignFirstResponder ();
 }
开发者ID:xNUTs,项目名称:CodeBucket,代码行数:11,代码来源:DialogViewController.cs


注:本文中的UISearchBar.ResignFirstResponder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。