Reputation: 491
Hi can anyone help me how text can be highlighted after search, i want to search data from sqlite database and display it in a UITableView, so how i can highlight the search keyword only in the search Result? Please help?
Upvotes: 5
Views: 2315
Reputation: 2368
Here's how I would do it: Create a custom cell, and a view in that cell, to include the text. You will need to use core text to be able to change the parts of background/text color from your string. Upon your search, change the color/background color of text in drawRect method.
Please see this for more about Core Text.
Upvotes: 1