문제

When setting a SearchBarDisplay, using IB or programmatically it gets a Cancel button right to the search window. The text on the button says "Cancel". How do I change text to another language. I know how to change text for a Done button at the Navbar using only SearchWindow but that does not seem to work for this button which comes as default.

And a similar question is the text "No result" coming up in the table if no match. How change to another language?

도움이 되었습니까?

해결책

You can change title of you cancel but of searchBar by this :

for (UIButton *v in srchBar.subviews) 
{
    NSLog(@"%@",v);

    if ([v isKindOfClass:[UIButton class]])
    {
        [v setTitle:@"Hello" forState:UIControlStateNormal];
    }
}

now set this title as per your language.

i tried this and its working in my demo app.

let me know if it wont work for you.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top