A titanium alloy widget that consists in a label that highlights the occurrences searched inside its text. It uses the new AttributedString API for iOS introduced in Titanium 3.2
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
plugins/ti.alloy
.gitignore
CHANGELOG.txt
LICENSE
LICENSE.txt
README.md
demo preview.m4v
manifest
screenshot.png
tiapp.xml

README.md

TiHighlightLabel Widget and demo project

This Titanium + Alloy project demonstrates the use of AttributedString component introduced in Titanium 3.2 for iOS7.

TiHighlightLabel is a normal label that allows to highlight dynamically part of its text.

Screenshot

It implements a search method to easily highlight all the occurrences in its text.

All its behaviour is like a normal label. Look into index.tss to see an example on how to style the label and the highlighted parts and index.xml to see how to use it in a view.

Note that for initializing the label you can set the text property in your tss file. But for initializing or setting the text from the controller, you need to access to the widget's view, which means call to $.yourlabel.getView().text = 'new value';

License

Code and project under MIT License

Original code, documentation and example by Javier Rayon - 2014 twitter: @jrayon http://www.criteriastudio.com javier at criteriastudio ' com