Tips for using AndroidUI components in ListView: androiduilistview

Source: Internet
Author: User

Tips for using AndroidUI components in ListView: androiduilistview
Android: fadingEdge = "none" // go to shadow
Android: listSelector = "@ android: color/transparent" // removes the click effect of an Item.

Android: scrollbars = "none" // remove the scroll bar

Android: cacheColorHint = "#00000000" // transparent background color

Android: divider = "@ null" // No Separator

If you find that the last Item of the ListView cannot be normally displayed in a layout, You need to place your listView control on the lower control using the above attribute.

Here, we only record what ListView is commonly used to quickly find and use it next time.

Reprinted please indicate the source: http://blog.csdn.net/android_jiangjun/article/details/39895297


Android listview obtains components in an item

I wonder why you want to do this. This is not advisable. The error is reported because in the onCreate method of the Activity, listview does not have a subview, list. getChildAt () is naturally null, and you must report a null pointer exception when operating on it. In addition, when the listview has a Header, getChildAt (0) will get the Header. Please note that.

The android listview can hide a component in all sub-items in one click.

At the same time, it is better to hide all Items than to hide a single simple point. Simply use a boolean to control it.
Determine whether the value is true or false in getView to display/hide tv1 and tv2.
When you click a button on the top of the ListView, set boolean to true and then adapter. setpolicychanged: Let the listView update it again, which is equivalent to getView again, and then judge boolean again to display or hide tv1 and tv2. Click the button again, modify the boolean value, and then update the adapter.

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.