* Indicates whether the list selector should be drawn on top of the children or behind
*/
boolean mDrawSelectorOnTop = false; 表明了list selector是否应该绘制在children的顶部还是后面
/**
* The drawable used to draw the selector
*/
Drawable mSelector;分隔符的图片
/**
* The current position of the selector in the list.
*/
int mSelectorPosition = INVALID_POSITION; 目前选择selector的位置
/**
* Defines the selector's location and dimension at drawing time
*/
Rect mSelectorRect = new Rect(); 定义selector的位置和区域在绘制时
/**
* The data set used to store unused views that should be reused during the next layout
* to avoid creating new ones
*/
final RecycleBin mRecycler = new RecycleBin(); Listview的缓存机制
/**
* The selection's left padding
*/
int mSelectionLeftPadding = 0;
/**
* The selection's top padding
*/
int mSelectionTopPadding = 0;
/**
* The selection's right padding
*/
int mSelectionRightPadding = 0;
/**
* The selection's bottom padding
*/
int mSelectionBottomPadding = 0;
/**
* This view's padding
*/
Rect mListPadding = new Rect();
以上属性表示Padding
本文深入解析了Android中ListView的Selector机制,包括Selector的绘制位置、使用的Drawable资源、当前选择的位置等核心属性。同时介绍了ListView的缓存机制以及Selector在绘制过程中的定位与尺寸设置。
808

被折叠的 条评论
为什么被折叠?



