第124页
单链DNA (原来我和你,深处在不同的坐标系)
- 页码:第124页
Listview tips: " 1.Don’t use wrap content. Never use wrap_content for a list view’s height attribute. A list is a scroll con-tainer, and by definition is infinitely large, so you should always let a ListView fill_parent (or let it otherwise expand itself, for example, using layout_weight). 2.Be careful with clickable list items . Generally, when you click a list item, the list item itself receives the clickevent—the view or container that’s the root element of the item layout. If you place a button inside an item layout, the button steals the focus from the list item, which means while the button remains clickable, the list item itself can neither be focused nor clicked. You can mitigate this effect to at least let the entire list item be focusable again by setting ListView.setItemsCanFocus(false), which will bring back the list highlight when selecting that item. But any click handling must still be performed on a per-ele-ment basis inside your item layout. 3.Pay attention to getView performance List views can be performance killers. The getView method of an adapter is used to render a list item and is called frequently. You should avoid doing expensive operations like view inflations, or at least cache them. Reuse views, and consider the ViewHolder pattern we introduced earlier. "
说明 · · · · · ·
表示其中内容是对原文的摘抄