'ListView tools:listitem not working in android studio 2.2 stable channel
Steps to Reproduce:
- Open Layout editor
- Add a ListItem
- Specify tools:listitem property with a valid row_layout
What should happen:
It should use the layout from tools:listitem to render list items.
Actual result:
Nothing changes, it still shows the default list with generic views
Bug Report
I could see this bug was already filed on Jul 5, 2016 Bug Report Link
Are there any work around available to render list?
Solution 1:[1]
One thing to notice: it's tools:listitem
not tools:listItem
which is somewhat confusing. Took me some time to figure that out, since Android Studio currently doesn't provide autocompletion for that.
Solution 2:[2]
You must define an id i.e. android:id="@+id/list_view" to your list
Solution 3:[3]
Another reason why tools:listItem
doesn't work is when you're using the AndroidX's RecyclerView when using an older Android Studio. Update to 3.2 or higher and it will work.
Solution 4:[4]
This is fixed in Android Studio 2.3 beta 1
Solution 5:[5]
File -> Invalidate Caches and Restart
fixed the issue for me
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | Nagaraj Wadakannavar |
Solution 3 | Cristan |
Solution 4 | Cristan |
Solution 5 | Ibramazin |