Android: dividerHeight = 1px/>
Attribute name |
Description |
Android: choiceMode |
Specifies the selection mode used by the ListView. The list mode is not selected by default. The attribute value must be set to one of the following constants: none; the value is 0, indicating no selection mode; SingleChoice, with a value of 1, indicates that up to one item can be selected; MultipleChoice. The value is 2, indicating that multiple items can be selected. See the global attribute resource symbol choiceMode. |
Android: divider |
Specifies that List items are separated by a certain image or color. You can use @ [+] [package:] type: name or? [Package:] [type:] name (topic attribute) to point to an existing resource. You can also use # rgb, # argb, # rrggbb or # aarrggbb format to indicate a color. See the global attribute resource symbol divider. |
Android: dividerHeight |
The height of the separator. If the height is not specified, the inherent height of this separator is used. It must be a floating point in units, such as 14.5sp. Available units such as px (pixel), dp (density-independent pixels irrelevant to the density ), sp (scaled pixels based on preferred font size is a fixed proportion of pixels based on the font size), in (inches), mm (millimeters ). You can use @ [package:] type: name Or? The format of [package:] [type:] name (topic attribute) directs to a resource that contains this type of value. See the global attribute resource symbol dividerHeight. |
Android: entries |
Reference an array that will be used in this ListView. If the array is fixed, using this attribute is easier than writing in a program. It must start with @ [+] [package:] type: name or? [Package:] [type:] name to point to a resource. See the global attribute resource symbol entries. |
Android: footerDividersEnabled |
When set to flase, this ListView will not draw a separator before the footer view. The default value of this attribute is true. The property value must be set to true or false. You can use @ [package:] type: name Or? The format of [package:] [type:] name (topic attribute) directs to a resource that contains this type of value. See the global attribute resource symbol footerDividersEnabled. |
Android: headerDividersEnabled |
When set to flase, this ListView will not draw a separator behind the header view. The default value of this attribute is true. The property value must be set to true or false. You can use @ [package:] type: name Or? The format of [package:] [type:] name (topic attribute) directs to a resource that contains this type of value. See the global attribute resource symbol headerDividersEnabled. |
Conflict:
1. When the listview is dragged, the background image disappears into a black background. After the drag is completed, our own background image will be displayed.
2. There is a black shadow on the top and bottom of the listview.
3. Set an image as the interval between each item in lsitview.
Set the statement in the xml file of listview to solve the above problem.
Problem 1: Solve android with the following code: scrollingCache = false
Problem 2: Use the following code to solve the problem: android: fadingEdge = none
Problem 3: Use the following code to solve the problem: android: divider = @ drawable/list_driver where @ drawable/list_driver is an image resource.
Overall:
Android: id = @ + id/myListView01
Android: layout_width = fill_parent
Android: layout_height = 300dip
Android: fadingEdge = none
Android: divider = @ drawable/list_line
Android: scrollingCache = false
Android: background = @ drawable/list_background>
Attribute name |
Description |
Android: choiceMode |
Specifies the selection mode used by the ListView. The list mode is not selected by default. The attribute value must be set to one of the following constants: none; the value is 0, indicating no selection mode; SingleChoice, with a value of 1, indicates that up to one item can be selected; MultipleChoice. The value is 2, indicating that multiple items can be selected. See the global attribute resource symbol choiceMode. |
Android: divider |
Specifies that List items are separated by a certain image or color. You can use @ [+] [package:] type: name or? [Package:] [type:] name (topic attribute) to point to an existing resource. You can also use # rgb, # argb, # rrggbb or # aarrggbb format to indicate a color. See the global attribute resource symbol divider. |
Android: dividerHeight |
The height of the separator. If the height is not specified, the inherent height of this separator is used. It must be a floating point in units, such as 14.5sp. Available units such as px (pixel), dp (density-independent pixels irrelevant to the density ), sp (scaled pixels based on preferred font size is a fixed proportion of pixels based on the font size), in (inches), mm (millimeters ). You can use @ [package:] type: name Or? The format of [package:] [type:] name (topic attribute) directs to a resource that contains this type of value. See the global attribute resource symbol dividerHeight. |
Android: entries |
Reference an array that will be used in this ListView. If the array is fixed, using this attribute is easier than writing in a program. It must start with @ [+] [package:] type: name or? [Package:] [type:] name to point to a resource. See the global attribute resource symbol entries. |
Android: footerDividersEnabled |
When set to flase, this ListView will not draw a separator before the footer view. The default value of this attribute is true. The property value must be set to true or false. You can use @ [package:] type: name Or? The format of [package:] [type:] name (topic attribute) directs to a resource that contains this type of value. See the global attribute resource symbol footerDividersEnabled. |
Android: headerDividersEnabled |
When set to flase, this ListView will not draw a separator behind the header view. The default value of this attribute is true. The property value must be set to true or false. You can use @ [package:] type: name Or? The format of [package:] [type:] name (topic attribute) directs to a resource that contains this type of value. See the global attribute resource symbol headerDividersEnabled. |
Attentive friends should find that after the background is set in listview. There will be some problems.
1. When the listview is dragged, the background image disappears into a black background. After the drag is completed, our own background image will be displayed.
2. There is a black shadow on the top and bottom of the listview.
3. Set an image as the interval between each item in lsitview.
Set the statement in the xml file of listview to solve the above problem.
Problem 1: Solve android with the following code: scrollingCache = false
Problem 2: Use the following code to solve the problem: android: fadingEdge = none
Problem 3: Use the following code to solve the problem: android: divider = @ drawable/list_driver where @ drawable/list_driver is an image resource.
Overall:
Android: id = @ + id/myListView01
Android: layout_width = fill_parent
Android: layout_height = 287dip
Android: fadingEdge = none
Android: divider = @ drawable/list_driver
Android: scrollingCache = false
Android: background = @ drawable/list>