How to change Highlight color of the selected ListView item in UWP (Windows 10)

Actually a better way to discover the styling properties is to use Blend. First, open up your page in Blend. Then right click on your ListView and go Edit Additional Templates > Edit Generated Item Container (ItemContainerStyle) > Edit a Copy. Give it a name and hit OK. Now, you have generated the full built-in … Read more

Different delegates for QML ListView

I’ve had the same problem, the Qt documentation is providing a pretty good answer: http://doc.qt.io/qt-5/qml-qtquick-loader.html#using-a-loader-within-a-view-delegate The easiest solution is an inline Component with a Loader to set a source file: ListView { id: contactsView anchors.left: parent.left anchors.top: parent.top width: parent.width height: parent.height orientation: Qt.Vertical spacing: 10 model: contactsModel delegate: Component { Loader { source: switch(position) … Read more

Disable scrolling of a ListView contained within a ScrollView

I found a very simple solution for this. Just get the adapter of the listview and calculate its size when all items are shown. The advantage is that this solution also works inside a ScrollView. Example: public static void justifyListViewHeightBasedOnChildren (ListView listView) { ListAdapter adapter = listView.getAdapter(); if (adapter == null) { return; } ViewGroup … Read more

How to show alphabetical letters on side of Android ListView

I forgot to instantiate alphaIndexer. Works perfectly now. class AlphabeticalAdapter extends ArrayAdapter<String> implements SectionIndexer { private HashMap<String, Integer> alphaIndexer; private String[] sections; public AlphabeticalAdapter(Context c, int resource, List<String> data) { super(c, resource, data); alphaIndexer = new HashMap<String, Integer>(); for (int i = 0; i < data.size(); i++) { String s = data.get(i).substring(0, 1).toUpperCase(); if (!alphaIndexer.containsKey(s)) … Read more

how to save image taken from camera and show it to listview – crashes with “IllegalStateException”

As per you create database statement private static final String SCRIPT_CREATE_DATABASE = “create table ” + DATABASE_TABLE + ” (” + KEY_ROWID + ” integer primary key autoincrement, ” + KEY_TITLE + ” text not null, ……+KEY_COMMENTS+” text not null,”+KEY_IMAGE+” imageblob BLOB);”; you are mentioned that “+KEY_IMAGE+” imageblob BLOB so the column value is “imageblob … Read more

Endless scrolling listview not working

To Show only 10 item first time in ListView and show more items on scroll follow following steps: STEP 1: Create a chunkList method which divide ArrayList in parts of size 10: static <T> List<ArrayList<T>> chunkList(List<T> list, final int L) { List<ArrayList<T>> parts = new ArrayList<ArrayList<T>>(); final int N = list.size(); for (int i = … Read more