Customize UISearchDisplayController

后端 未结 3 755
后悔当初
后悔当初 2021-02-06 13:08

alt text http://img210.imageshack.us/img210/5992/searchdisplaycontroller.png

Are the following objects customizable?

1. UISearchBar Scope Buttons (UISegm

3条回答
  •  不知归路
    2021-02-06 13:35

    alt text http://img527.imageshack.us/img527/9775/searchdisplaycontrollerz.png

    I was able to change the segmented control by a sort-of hack code:

    - (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller {
    for (UIView *subview in self.view.subviews) {
        for (UIView *subview2 in subview.subviews) {
            if ([subview2 isKindOfClass:[UISegmentedControl class]]) {
                UISegmentedControl *segmentedControl = (UISegmentedControl *)subview2;
                segmentedControl.tintColor = [UIColor blackColor];
                segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
            }           
        }
    }}
    

    However the buttons are HUGE, how could I fix it so they are just as pretty as the original?

提交回复
热议问题