1

I've created a custom UISearchBarDelegate. In the OnEditingStarted-event, I'm adding scope buttons to the search bar:

public override void OnEditingStarted(UISearchBar searchBar)
{
    searchBar.ScopeButtonTitles = new[] { "Scope 1", "Scope 2" };
    searchBar.ShowsCancelButton = true;
    searchBar.ShowsScopeBar = true;
}

This is working as expected, the scope buttons are shown underneath the search field.

The only thing is, I'm not able to toggle the scope. When tapping "Scope 2" nothing happens, not even visually.

Are there any other settings one is supposed to do, in order get this working? Are there known/common pitfalls that can prevent (scope)buttons from working?

Jacco
  • 3,251
  • 1
  • 19
  • 29
  • Are you using `UISearchDisplayDelegate` anywhere? If so, can you post your code for it? There is a `ShouldReloadForSearchScope` that needs to be overridden. – jonathanpeppers Dec 28 '12 at 22:36
  • No, I'm not using a UISearchDisplayDelegate. I was thinking, that even without wiring up events or delegates, the buttons should at least change color when tapped. Did you ever encounter that behavior? – Jacco Dec 29 '12 at 20:48
  • I've never had this issue. Implement the `UISearchDisplayDelegate` real quick and see if it fixes your issue. – jonathanpeppers Dec 31 '12 at 16:43

0 Answers0