Iphone UISearchBar的setRightView在iOS 7中不工作
我在右边的搜索栏中添加了一个按钮Iphone UISearchBar的setRightView在iOS 7中不工作,iphone,ios,ios6,ios7,Iphone,Ios,Ios6,Ios7,我在右边的搜索栏中添加了一个按钮 [searchtextfield setRightView:customButton]; [searchtextfield setRightViewMode:UITextFieldViewModeAlways]; 它可以运行到iOS 6,但在iOS 7中我看不到它。你知道如何在iOS 7中实现它吗。如果你有白色背景,那么可能是你看不到搜索栏的问题,我也遇到了同样的问题,但通过设置表视图背景添加了这段代码,成功地解决了这个问题 UIView *backgro
[searchtextfield setRightView:customButton];
[searchtextfield setRightViewMode:UITextFieldViewModeAlways];
它可以运行到iOS 6,但在iOS 7中我看不到它。你知道如何在iOS 7中实现它吗。如果你有白色背景,那么可能是你看不到搜索栏的问题,我也遇到了同样的问题,但通过设置表视图背景添加了这段代码,成功地解决了这个问题
UIView *backgroundView = [[UIView alloc] initWithFrame:self.tableView.bounds];
backgroundView.backgroundColor = [UIColor clearColor];
self.tableView.backgroundView = backgroundView;
希望能有帮助。谢谢。试着设置UI的色调。搜索barIt与色调无关。我可以看到搜索栏,我看不到我设置为rightView的按钮。啊,我想你会看到这个链接“”,希望能有所帮助。如果你愿意,那就提出我的观点。