migueldeicaza / MonoTouch.Dialog

Tools to simplify creating dialogs with the user using MonoTouch
MIT License
431 stars 211 forks source link

Enable Scope Bars #199

Open henrikweimenhog opened 11 years ago

henrikweimenhog commented 11 years ago

Add Scope bar functionality by making the following changes:

DialogViewController:

bool enableScope;
public bool EnableScope {
    get {
        return enableScope;
    }
    set {
        if (enableScope == value)
            return;

        if (tableView != null)
            throw new ArgumentException ("You should set EnableScope before the controller is shown");
        enableScope = value;
    }
}

DialogViewController -> SetupSearch()

replace

searchBar = new UISearchBar (new RectangleF (0, 0, tableView.Bounds.Width, 44)) {

with

var height = (enableScope) ? 90 : 44;
searchBar = new UISearchBar (new RectangleF (0, 0, tableView.Bounds.Width, height)) {