Posts

Showing posts from September, 2019

Find and Highlight text in ListView

Image
Follow the steps given below to find and highlight text, entered in EditText, in a custom  ListView  in Sketchware. This method makes the use of class Spannable.

1. In VIEW area of your sketchware project, add an EditText and a ListView (edittext1 and listview1).


2. Add a new CustomView custom.xml. In this CustomView add two TextViews (textview1 and textview2).

3. Now in properties of ListView, select the new CustomView added as it's customView.
4. In LOGIC area of your app, add a new List Map: maplist1., and a new Map: map1. Also add a Number variable index and three String variables Name, Number and term.


5. In onCreate event in your project, Create a new Map, add items to the Map using keys Name and Number (change or increase keys per your need), and add the Map to the List Map: maplist1. In this way add as many items as desired. In the end use Block setListCustomViewData to display the List Map in ListView. (See image below).

6. Add a new event​ ListView: onBindCustomView and…