Android Learning--android:cachecolorhint= "#00000000"

Source: Internet
Author: User

Listview.set Cachecolorhint (0) or android:cachecolorhint= "#000000" to remove the drag background color of the ListView

When customizing the ListView, when you do not use the android:cachecolorhint= "#00000000" will appear below to select a space for the black background of the case, damage the overall aesthetics:

When you do not use the Android:listselector property, the selected item is displayed by default as an orange background, and sometimes we need to remove the effect:


ListView Drag background image hidden 2013-07-19




123456789101112131415161718192021222324252627282930
<!-- 最后一条item所在的位置会闪烁 -->               <ListView                android:id="@+id/recommand_app_list"                android:layout_width="fill_parent"                android:layout_height="fill_parent"                android:layout_below="@id/recommands_list_view_header_divider"                android:fadingEdge="none"                android:scrollbars="none"                android:scrollingCache="true"            </ListView          <!--修复问题: 最后一条item所在的位置会闪烁 -->               <ListView                android:id="@+id/recommand_app_list"                android:layout_width="fill_parent"                android:layout_height="fill_parent"                android:layout_below="@id/recommands_list_view_header_divider"                android:background="@drawable/ic_content_bg_repeat"                android:divider="@drawable/ic_list_divider_repeat"                android:dividerHeight="1dp"                android:fadingEdge="none"                android:persistentDrawingCache="none"                android:scrollbars="none"                android:scrollingCache="false"                android:smoothScrollbar="true"            </ListView>

The ListView is a frequently used Android control that summarizes some of the little landscaping details that have been encountered.

1, the ListView in the drag when the background image disappears into a black background, wait until the drag is complete our own background picture only then displays

Workaround: Add in XML

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

2, the top and bottom of the ListView has a black shadow

FIX: android:fadingedge= "None"

3. Modify the yellow background when the ListView item is selected by default

Workaround: Use the Listview.setselector () method in a Java file, or use the following code

1android:listselector= "#00000000"//This write is transparent, you can also add drawable pictures

4, Lsitview between each item need to set a picture as the interval

Solution: android:divider= "@drawable/list_driver"


http://blog.csdn.net/liuhanhan512/article/details/7225989

Android Learning--android:cachecolorhint= "#00000000"

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.