R ronovar Active Member Licensed User Longtime User May 4, 2016 #1 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: Code: Copy '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: May 4, 2016
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: Code: Copy '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
Erel B4X founder Staff member Licensed User Longtime User May 4, 2016 #2 Why do you need to create the layout in XML? Upvote 0
R ronovar Active Member Licensed User Longtime User May 4, 2016 #3 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
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
Erel B4X founder Staff member Licensed User Longtime User May 4, 2016 #4 Can you post a screenshot or image of the layout you are trying to implement? Upvote 0
R ronovar Active Member Licensed User Longtime User May 4, 2016 #5 You can see that aboce Item1 is missing divider and above Item8 is missing divider...how to enable it? Upvote 0
You can see that aboce Item1 is missing divider and above Item8 is missing divider...how to enable it?
DonManfred Expert Licensed User Longtime User May 4, 2016 #6 Listview does not have header of footer functionality. Use a customlistview instead and create your own layout. Upvote 0
Listview does not have header of footer functionality. Use a customlistview instead and create your own layout.
Erel B4X founder Staff member Licensed User Longtime User May 4, 2016 #7 You can put the ListView in a Panel with borders. See the attached example. As @DonManfred wrote you should use CustomListView if you need more customization. Attachments 1.zip 1.zip 7.6 KB · Views: 608 Upvote 0
You can put the ListView in a Panel with borders. See the attached example. As @DonManfred wrote you should use CustomListView if you need more customization.