UIToolBar *toolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 1024, 44)];
toolBar.barStyle = UIBarStyleBlack;
[self.view addSubview:toolBar];
UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"testText " style:0 target:nil action:nil];
UIBarButtonItem *barButtonDateItem = [[UIBarButtonItem alloc] initWithTitle:@" _________ " style:1 target:self action:@selector(dateButtonSelected)];
UIBarButtonItem *barButtonItem2 = [[UIBarButtonItem alloc] initWithTitle:@" " style:0 target:nil action:nil];
UISearchBar *searchBar1 = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 280, 100)];
UIBarButtonItem *barButtonSearchItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:0 target:nil action:nil];
barButtonSearchItem.customView = searchBar1;
barButtonSearchItem.width = 280;
NSArray *array = [[NSArray alloc] initWithObjects:barButtonItem,barButtonDateItem,barButtonItem2,barButtonSearchItem,nil];
[barButtonItem release];
[barButtonDataItem release];
[barButtonItem2 release];
[searchBar1 release];
[barButtonSearchItem release];
toolBar.items = array;
[array release];
Когда я щелкаю barButtonDataItem или barButtonSearchItem, только небольшая часть элемента может ответить на мое действие щелчка, а нижняя половина - нет.Как я могу сделать
Спасибо!