Common property issues with Android ListView

Source: Internet
Author: User

Question 1:

When the ListView is dragged, the background image disappears into a black background. Wait until we have finished dragging our own background image to show it.

Workaround:

In XML:

Android:scrollingcache= "false" or android:cachecolorhint= "#00000000"

In the code:

Setscrollingcacheenabled (False) or Setcachecolorhint (0) or setcachecolorhint (color.transparent);


Question 2:

The top and bottom of the ListView have a black shadow.

Workaround:

In XML:

Android:fadingedge= "None"

In the code:

Setfadingedgelength (0);


Question 3:

Lsitview each item requires a picture to be set as an interval.

Workaround:

In XML:

Android:divider= "@drawable/list_driver

In Java:

Drawable dr = This.getresources (). getdrawable (R.colo.listviewdividerclour);
Listview.setdivider (DR);


Question 4:

By default, the selected item is yellow-orange, and sometimes we need to remove the effect:

Workaround:

In XML:

Listselector= "@android: color/transparent

In Java:

listview.setselector (drawable);


This article is from the "Heart to Bodhi" blog, please be sure to keep this source http://zhongkun.blog.51cto.com/1057583/1407969

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.