简体   繁体   中英

I want to create a custom searchbar in objective-c in iOS

I want to create a custom searchbar looking like the following custom search bar but i haven't managed to duplicate this. This search is from another app we have in android phones and tablets.

Any help appreciated, thanks

Use UITextfield and set background image same like you have custom image and than use NSPredicate for searching.

 NSPredicate *predk = [NSPredicate predicateWithFormat:@"SELF beginswith[c] %@", searchString];
    NSArray *filtered = [your-Data-Array filteredArrayUsingPredicate:predk];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM