我想将带有两个按钮的UISearchbar添加到我的UIView中。我不想导航或表视图。
当用户从图纸打开模型视图页面时,将显示“搜索”选项并休息。当用户单击“搜索”按钮时,该按钮将可见。
我试图做,但是我没有得到想要的结果。



如何删除范围按钮的背景,我已经删除了uisearchbar,类似的方式,我不想按钮的白色背景。可能吗。 showsScopeBar我正在使FALSE仍然可以看到背景。

最佳答案

要删除范围按钮的背景图片,请尝试:

 Class segmentedControlBackgroundView = NSClassFromString(@"_UISegmentedControlBackgroundView");
    for(UIView *view in self.searchBar.subviews) {
        if([view isKindOfClass:[UISegmentedControl class]]){
            for(UIView *subview in view.subviews) {
                if ([subview isKindOfClass:segmentedControlBackgroundView]) {
                    subview.hidden = YES;
                }
            }
        }
    }

10-02 08:21
查看更多