2018-09-16 Advanced Control ListView

  1. BaseAdapter: is the parent class of all adapter classes, which can maximize the customization of list items. 1.1 Methods in Custom Adapters   *getCount Returns how many data the current ListView or Spinner controls should display.   *getView returns the layout of each option of ListView or Spinner. The function of this method is to parse the attempt file (layout layout file) of each line into a View object.   getItem returns which row of objects   getItemId Get the object ID of that line

    1.2 LayoutInflater (layout parser)     Used to parse the layout layout file into a View object, not new, need to use system services to obtain       Inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);

  2. ListViewOptimization 2.1 Reusing components with ConvertView   That is, the control that is hidden and invisible when dragging, reuse it instead of creating a new object each time

    2.2 Save the control with the inner class ViewHolder+ConvertView.setTag() instead of searching each time   ViewHolder (view holder): store controls specifically, reducing wasted resources