tags:

views:

24

answers:

1

Hi there! I'm using a listview with an adapter extending CursorAdapter. The listitems contains a few TextViews which can contain arbitrary lengths of text. The problem is now as the views (in the listview) are recycled, items might get alot higher than needed since a previous item in the view needed bigger space.

I guess that the solution is to somehow to not allow recycling, or just force set the size of the view upon it being bound. I've been trying a number of different solutions but I haven't found a way. Could someone please help me? ;)

    @Override
public View newView(Context context, Cursor c, ViewGroup parent) 
{


    settings = ctx.getSharedPreferences("myprefs", 0);

    View v = inflater.inflate(R.layout.convoview_list_item, parent,false);
    ctx2 = context;
    parentGroup = parent;       
    return v;
}
@Override
public void bindView(View v, Context context, Cursor c)
{
    //Adding text etc to my views from the cursor here.
    }
A: 

The problem was that in my bindView implementation made some TextViews "invisible" instead of "gone" and because of this they took up space even though you couldn't see them.

Isacj