Set ListView item height

后端 未结 4 763
闹比i
闹比i 2020-12-13 14:53

this should be a very easy thing to do, but it looks like it\'s very tricky. In my code I have this ListView:



        
4条回答
  •  不思量自难忘°
    2020-12-13 15:40

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      ...
      View v = inflater.inflate(R.layout.filtered_trip_row, parent,false);
      …
    
      return v;
    }
    

    just pass boolean value to the method so that it add the yourrowlayout to the listview and it will not give error futher like error java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView

    and add yourLayout which u wants to populate through Adapter

    
    ...
    
    

    it works for me and i think it may help you

提交回复
热议问题