Skip to content

Instantly share code, notes, and snippets.

@warwick
Created June 1, 2009 21:44
Show Gist options
  • Save warwick/121824 to your computer and use it in GitHub Desktop.
Save warwick/121824 to your computer and use it in GitHub Desktop.
var toolbarItem = [[CPToolbarItem alloc] initWithItemIdentifier:anItemIdentifier];
if ([anItemIdentifier isEqualToString:@"Search"]) { // Search isn't just an image, but a special view
[toolbarItem setLabel:@"Search"];
var searchView = [[CPTextField alloc] initWithFrame:CPRectMake(0, 0, 100, 29)];
[searchView setEditable:YES];
[searchView setBordered:YES];
[searchView setBezeled: YES];
[searchView setBezelStyle:CPTextFieldSquareBezel]
[toolbarItem setView:searchView];
return toolbarItem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment