public override void ViewDidLoad() { base.ViewDidLoad(); this.View.BackgroundColor = UIColor.FromRGB(239, 239, 244); dataSource = new AutoCompleteLoadDataDataSource(); this.Autocomplete = new TKAutoCompleteTextView(new CGRect(10, this.View.Bounds.Y + 10, this.View.Bounds.Size.Width - 20, 35)); this.AutomaticallyAdjustsScrollViewInsets = false; this.Autocomplete.SuggestMode = TKAutoCompleteSuggestMode.Suggest; this.Autocomplete.AutoresizingMask = UIViewAutoresizing.FlexibleWidth; this.Autocomplete.TextField.Placeholder = "Search airports"; this.Autocomplete.CloseButton.SetImage(UIImage.FromBundle("clear.png"), UIControlState.Normal); this.Autocomplete.ImageView.Image = UIImage.FromBundle(new NSString("search.png")); this.Autocomplete.MinimumCharactersToSearch = 1; this.Autocomplete.SuggestionViewHeight = this.View.Bounds.Height - this.View.Bounds.Y + 45; this.Autocomplete.WeakDataSource = dataSource; this.View.AddSubview(this.Autocomplete); }
public override void ViewDidLoad () { base.ViewDidLoad (); this.View.BackgroundColor = UIColor.FromRGB (239, 239, 244); dataSource = new AutoCompleteLoadDataDataSource (); this.Autocomplete = new TKAutoCompleteTextView(new CGRect(10, this.View.Bounds.Y + 10, this.View.Bounds.Size.Width - 20, 35)); this.AutomaticallyAdjustsScrollViewInsets = false; this.Autocomplete.SuggestMode = TKAutoCompleteSuggestMode.Suggest; this.Autocomplete.AutoresizingMask = UIViewAutoresizing.FlexibleWidth; this.Autocomplete.TextField.Placeholder = "Search airports"; this.Autocomplete.CloseButton.SetImage (UIImage.FromBundle ("clear.png"), UIControlState.Normal); this.Autocomplete.ImageView.Image = UIImage.FromBundle (new NSString("search.png")); this.Autocomplete.MinimumCharactersToSearch = 1; this.Autocomplete.SuggestionViewHeight = this.View.Bounds.Height - this.View.Bounds.Y + 45; this.Autocomplete.WeakDataSource = dataSource; this.View.AddSubview (this.Autocomplete); }