コード例 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.
            Auth.SetUserCredentials(TwitterCredentials.ConsumerKey,
                                    TwitterCredentials.ConsumerSecret,
                                    TwitterCredentials.AccessToken,
                                    TwitterCredentials.AccessTokenSecret);
            searchBar = new UISearchBar()
            {
                Placeholder       = "Busca los tweets",
                ShowsScopeBar     = false,
                ScopeButtonTitles = new string[] { "uwu", "owo", "ewe" }
            };

            var schController = new UISearchController();

            myTable.TableHeaderView = schController.SearchBar;

            searchBar.SearchBarStyle = UISearchBarStyle.Prominent;

            myTable.TableHeaderView = searchBar;

            searchBar.SearchButtonClicked += (sender, args) =>
            {
                ReloadMyTable(searchBar.Text);
                searchBar.PerformSelector(new ObjCRuntime.Selector("resignFirstResponder"), this, 0.5);
            };
        }