In the android listview, the checkbox and the drag listview background will disappear.

Source: Internet
Author: User

1. In android2.2, if checkbox is placed in the item of listview, The setonitemclicklistener listening event of listview is invalid.

The solution can be to set the checkbox to fail to obtain the focus and fail to click in the XML statement of the checkbox. However, the consequence is to maintain the status of the checkbox in the code, for example:

<Checkbox

Android: layout_width ="Wrap_content"

Android: layout_height ="Wrap_content"

Android: layout_marginright ="10dp"

Android: layout_alignparentright ="True"

Android: Id ="@ + ID/adapter_taskmanager_cb_appischeck"

Android: focusable ="False"

Android: clickable ="False"

/>

 

 

 

2. There are too many items in the listview. We often find that the background is missing when dragging the listview. In this case, you can set the attribute of cachecolorhint to "@ Android: color/transparent" for the listview ", this problem can be solved! For example:

<Listview

Android: Id = "@ + ID/taskmanager_lv_app"

Android: layout_width = "match_parent"

Android: layout_height = "match_parent"

Android: layout_weight = "1"

Android: cachecolorhint = "@ Android: color/transparent">

</Listview>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.