¡@

Home 

2014/10/16 ¤W¤È 08:21:13

android Programming Glossary: parent.getchildat

How can I change the background color for an specific row properly in a ListView? (Android)

http://stackoverflow.com/questions/4634796/how-can-i-change-the-background-color-for-an-specific-row-properly-in-a-listview

inside the parent for int i 0 i children i Log.i Log SingleSelectionListBox Child i has message TextView parent.getChildAt i .getText Too inefficient but for now is OK for int i 0 i children i parent.getChildAt i .setBackgroundColor NO_SELECTED_COLOR.. i has message TextView parent.getChildAt i .getText Too inefficient but for now is OK for int i 0 i children i parent.getChildAt i .setBackgroundColor NO_SELECTED_COLOR Log.i Log SingleSelectionListBox First visible position parent.getFirstVisiblePosition.. First visible position parent.getFirstVisiblePosition Set the background color TextView textView TextView parent.getChildAt position parent.getFirstVisiblePosition textView.setBackgroundColor SELECTED_COLOR Log.i Log SingleSelectionListBox..

Android GridView reorder elements via Drag and Drop

http://stackoverflow.com/questions/7146639/android-gridview-reorder-elements-via-drag-and-drop

x y if position AdapterView.INVALID_POSITION int count parent.getChildCount for int i 0 i count i View curr parent.getChildAt i curr.setOnDragListener new View.OnDragListener @Override public boolean onDrag View v DragEvent event boolean result.. false break return result int relativePosition position parent.getFirstVisiblePosition View target View parent.getChildAt relativePosition DragGridItemHolder holder DragGridItemHolder target.getTag GridItem currentItem holder.item String text..