thedesolatesoul Expert Licensed User Longtime User Feb 4, 2012 #1 Hello, I know I am doing something unorthodox here, (but what can I do I cannot get rid of this idea from my head!) I was thinking if there is some way of modifying a listview to add a checkbox in there (and toggle whether it is shown or not)...however I failed at the first hurdle. I cannot remove a label from the listview Code: Copy customlv.TwoLinesAndBitmap.Label.RemoveView I know people will suggest me to use a scrollview etc (i will end up doing that eventually)...but I just to know if it is possible to replace one label with a checkbox...with a quick and dirty hack. Here is the entry in the SDK docs: TwoLineListItem | Android Developers It says, and I quote: Android supplies a standard layout resource for TwoLineListView (which does not include a selected item icon), but you can design your own custom XML layout for this object. Click to expand... ...and so I stumbled on: R.layout | Android Developers ...wondering if I can replace: public static final int two_line_list_item Since: API Level 1 Constant Value: 17367053 (0x0109000d) Click to expand... with: public static final int simple_selectable_list_item Since: API Level 11 A simple ListView item layout which can contain text and support (single or multiple) item selection. Constant Value: 17367061 (0x01090015) Click to expand... Or even: public static final int simple_list_item_checked Since: API Level 1 Constant Value: 17367045 (0x01090005) Click to expand... Or: public static final int simple_expandable_list_item_1 Since: API Level 1 Constant Value: 17367046 (0x01090006) Click to expand... I have looked at the ListViewWrapper and understand nothing! But I do think that the wrapper is not using these layouts and creating them in the wrapper. ...so I do not think this will work. But I thought I should throw it out there :sign0163:
Hello, I know I am doing something unorthodox here, (but what can I do I cannot get rid of this idea from my head!) I was thinking if there is some way of modifying a listview to add a checkbox in there (and toggle whether it is shown or not)...however I failed at the first hurdle. I cannot remove a label from the listview Code: Copy customlv.TwoLinesAndBitmap.Label.RemoveView I know people will suggest me to use a scrollview etc (i will end up doing that eventually)...but I just to know if it is possible to replace one label with a checkbox...with a quick and dirty hack. Here is the entry in the SDK docs: TwoLineListItem | Android Developers It says, and I quote: Android supplies a standard layout resource for TwoLineListView (which does not include a selected item icon), but you can design your own custom XML layout for this object. Click to expand... ...and so I stumbled on: R.layout | Android Developers ...wondering if I can replace: public static final int two_line_list_item Since: API Level 1 Constant Value: 17367053 (0x0109000d) Click to expand... with: public static final int simple_selectable_list_item Since: API Level 11 A simple ListView item layout which can contain text and support (single or multiple) item selection. Constant Value: 17367061 (0x01090015) Click to expand... Or even: public static final int simple_list_item_checked Since: API Level 1 Constant Value: 17367045 (0x01090005) Click to expand... Or: public static final int simple_expandable_list_item_1 Since: API Level 1 Constant Value: 17367046 (0x01090006) Click to expand... I have looked at the ListViewWrapper and understand nothing! But I do think that the wrapper is not using these layouts and creating them in the wrapper. ...so I do not think this will work. But I thought I should throw it out there :sign0163:
Erel B4X founder Staff member Licensed User Longtime User Feb 5, 2012 #2 You will not be able to use these resources. Note that you can hide the label by setting its visibility to false. Upvote 0
You will not be able to use these resources. Note that you can hide the label by setting its visibility to false.
thedesolatesoul Expert Licensed User Longtime User Feb 5, 2012 #3 Thanks Erel. I thought it was worth a shot (in the dark!) I've been using a lot of scrollviews recently...I should probably great a generalised version. Upvote 0
Thanks Erel. I thought it was worth a shot (in the dark!) I've been using a lot of scrollviews recently...I should probably great a generalised version.