UISearchBar Scope Bar Position?

I am here on an iPad application and I would like to know if it is possible to move the visibility bar on the right to my UISearchBar to another position?

enter image description here

I want my visibility bar below my search bar. Is it possible?

Thanks in advance.

+4
source share
1 answer

Ok, this is my solution for this. Ill implemented my own segmented control to create the ability for a search area.

    let categories = ["Scope1", "Scope2", "Scope3"]
    segmentedControl.addTarget(self, action: "changeScope:", forControlEvents: .ValueChanged) 
    segmentedControl.frame = CGRectMake(8, 5, 800, 30)
    segmentedControl.backgroundColor = UIColor.whiteColor()
    segmentedControl.tintColor = UIColor.darkGrayColor()

    // add it in a scrollView, because ill got too much categories here. Just if you need that:

    scrollView.contentSize = CGSizeMake(segmentedControl.frame.size.width + 16, segmentedControl.frame.size.height-1)
    scrollView.showsHorizontalScrollIndicator = false;
    // set first category
    segmentedControl.selectedSegmentIndex = 0
    scrollView.addSubview(segmentedControl)

Here is the function for the visibility bar, always needed when the user switches the scope:

func changeScope(sender: UISegmentedControl) {
    switch(sender.selectedSegmentIndex) { 
    }
 }

, resultArrays Webservice, ( )

, - .

+2

All Articles