Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (31 sloc) 0.795 kB
//
// C# port of the searchbar sample
//
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System.Drawing;
public partial class SearchBarController : UIViewController {
UISearchBar bar;
class SearchDelegate : UISearchBarDelegate {
public override void SearchButtonClicked (UISearchBar bar)
{
bar.ResignFirstResponder ();
}
public override void CancelButtonClicked (UISearchBar bar)
{
bar.ResignFirstResponder ();
}
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
Title = "Search Bar";
View.BackgroundColor = UIColor.GroupTableViewBackgroundColor;
var f = new RectangleF (0f, 0f, View.Bounds.Width, 44f);
bar = new UISearchBar (f){
Delegate = new SearchDelegate (),
ShowsCancelButton = true,
};
View.AddSubview (bar);
}
}
Jump to Line
Something went wrong with that request. Please try again.