An example analysis of the abstract class Abslistview usage of Android programming learning _android

Source: Internet
Author: User

This article illustrates the abstract class Abslistview usage of Android programming learning. Share to everyone for your reference, specific as follows:

I. The relationship of inheritance

Public abstract class Abslistview extends adapterview <t extendsadapter>

Java.lang.Object
Android.view.View
Android.view.ViewGroup
Android.widget.adapterview<t extends Android.widget.adapter>
Android.widget.AbsListView

Ii. Overview of Abslistview

A base class for implementing a virtual list for a series of entries, but the list does not have a space definition here. For example, subclasses of this class can display the contents of this virtual list as a grid, a rotatable list, or a stack, and so on.

Three, nested class

Class Abslistview.layoutparams//abslistview implements Layoutparams to provide space for loading view types.
interface abslistview.mutichoicemodelistener//Mutichoicemodelistener is a multiple-selection mode listener that responds to a choice_mode_multiple_ MODAL (from API level).
Interface abalistview.onscrolllistener//provides a callback function that fires when the view is scrolled.
interface abslistview.recyclerlistener//is used to receive listeners for messages that are sent when view is placed in the heap to be reclaimed.

Four, XML attributes

XML attributes for 1.AbsListView

android:cachecolorhint//indicates that the background of this list is always drawn in a single, fixed color, and can be optimized for the drawing process. 
android:choicemode//Specifies the selected behavior for the view. The optional types are: None, Singlechoice, Multiplechoice, Multiplechoicemodal. 
android:drawselectorontop//If set to True, the selector is drawn to the top of the selected entry. The default is False. The 
android:fasescrollenabled//setting allows the use of the Fast scrolling slider. 
android:listselector//Sets the selected items to display as a drawing object, which can be either a picture or a color attribute. 
android:scrollingcache//sets whether to use the draw cache when scrolling. If set to true, the scrolling performance will be faster, but will consume more memory. The default is true. 
when android:smoothscrollbar//is true, the list uses a more precise method of calculating the height of the visible pixels on the screen based on the entries. This property is true by default, and if your adapter needs to draw a variable-high entry, he should set it to false. When this property is true, when the adapter displays a variable height entry, the handle of the scroll bar changes size during scrolling. When set to False, the list uses only the number of entries in the adapter and the visible entries on the screen to determine the properties of the scroll bar. 
android:stackfrombottom//Sets whether the GridView and ListView display content from the bottom. 
android:textfilterenabled//When set to True, the list filters the results into the user type. The prerequisite is that the adapter of this list must support the Filterable interface. 
android:transcriptmode//Sets the Transcriptmode of the list. The following options are available: 
//(1) Disabled     disables Transcriptmode, which is also the default value; 
(2) Normal       when the new entry is added to the list and is ready to be displayed, the list automatically slides to the bottom to display the latest entries; 
(3) Alwaysscroll  

2. Xml attributes inherited from ViewGroup

The
 android:addstatesfromchildren//sets whether the ViewGroup state of this drawable includes the state of the child view.
If set to true, the entire viewgroup also gets the focus when the child view, such as edittext or button, gets the focus. The android:alwaysdrawnwithcache//setting viewgroup whether the drawing cache is always used when drawing child view.
The default is true. android:animationcache//sets whether the layout creates a drawing cache for its child view when the animation effect is drawn. If set to true, more memory will be consumed, requiring a longer initialization process, but better performance.
The default is true. android:clipchildren//sets whether the child view is limited to drawing within its own bounds. If set to false, the child view can be drawn outside the bounds when it occupies more space than the boundary.
The default is true. android:cliptopadding//defines whether there is spacing between layouts.
The default is true. android:descendantfocusability//defines the relationship between ViewGroup and its child view when looking for a focus view.
Options are://(1) beforedescendants ViewGroup will get the focus more first than its child view;
(2) Afterdescendants only when No child view wants to gain focus, ViewGroup gets focus;
(3) Blockdescendants ViewGroup will prevent child view from getting focus android:layoutanimation//define the animation effect when ViewGroup first expands, or it can be invoked artificially after the first expansion. android:persistentdrawingcache//defines the persistence of the drawing cache. Like the next option://(1) None after using the drawing cache//(2) animation retains the drawing cache after layout animation//(3) scrolling retains the drawing cache after the scroll operation//(4) Al L always keep the drawing cache 

I hope this article will help you with your Android programming.

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.