Android Question GetView XmlLayoutBuilder ListView

ronovar

Active Member
Licensed User
I would like to add to View ListView that is defined in xml file...because i see that is the only way that my apk looks same on all devices...i successfully added textview, imageviews, panels...but i im unable to add ListView...

I know that i can add panel using xml to apk...then using dim lv as ListView and then panel.addView(lv, ...)

But i would like to add to apk ListView using xml..because i have then more styles to apply.

here i sthe code that i try:

B4X:
'DEFINE - XmlLayoutBuilder
    Dim Xml As XmlLayoutBuilder

'DEFINE - ListView
    Dim lv As ListView

lv = Xml.GetView("lv")

And i im getting this error:

java.lang.ClassCastException: android.widget.ListView cannot be cast to anywheresoftware.b4a.objects.ListViewWrapper$SimpleListView


I need this to add top and bottom divider in ListView...if is possible using reflector or javaobject then will be great.

I see that this i need to add:
http://developer.android.com/intl/r...tView.html#attr_android:footerDividersEnabled

I set setapplicationattribute in manifest editor but top and bottom dividers are not shown
 
Last edited:

ronovar

Active Member
Licensed User
Ok not need..i create panel in xml and added in b4a listview to panel....i need to add top and bottom in listview divider because when i scroll up and down it move whole listview 1 or 2 px up or down...

So if you can give example how to turn on in listview to show in footer and header divider
 
Upvote 0

ronovar

Active Member
Licensed User
mmRV3lW.png


You can see that aboce Item1 is missing divider and above Item8 is missing divider...how to enable it?
 
Upvote 0
Top