Here is my GetView method.

public View getView(int position, View convertView, ViewGroup parent)
{
    LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
                             LayoutParams.WRAP_CONTENT,
                             LayoutParams.WRAP_CONTENT);
    lp.topMargin = 20;

    ViewHolder holder;
    if (convertView == null) {
        convertView = mInflater.inflate(R.layout.property_row, null);
        holder = new ViewHolder();
        holder.text = (TextView)
convertView.findViewById(R.id.txtRowTitle);
        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }

    if (position == 0)
        convertView.setLayoutParams(lp);
    else
        //need to remove margin

 
holder.text.setText(ArrListFiltered.get(position).get("name").toString());
    return convertView;
}


I also tried folowing with no success:
    1) LayoutParams lp = (LayoutParams) parent.getLayoutParams();
    2) RelativeLayout.LayoutParams lp = new
RelativeLayout.LayoutParams(
                             LayoutParams.WRAP_CONTENT,
                             LayoutParams.WRAP_CONTENT);
    3) ViewGroup.MarginLayoutParams lp = new
ViewGroup.MarginLayoutParams(
                             LayoutParams.WRAP_CONTENT,
                             LayoutParams.WRAP_CONTENT);

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to