BaseAdapter don't hide layout with setVisibility(View.GONE)

I have a little problem. I have class private static class EfficientAdapter extends BaseAdapter { private LayoutInflater mInflater; public EfficientAdapter(Context context) { mInflater = LayoutInflater.from(context); } // return size of elements public int getCount() { return BridgeJSON.listFromJSON.getItem().size(); } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { position_move = 0; convertView = mInflater.inflate(R.layout.row, null); holder = new ViewHolder(); holder.txt_description = (TextView) convertView .findViewById(R.id.description_event); ...... convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } if (listFromJSON.getItem().get(position).isViewed() == false) { convertView.setBackgroundColor(Color.RED); this.notifyDataSetChanged(); } else { // get text for description String txt_for_description = listFromJSON.getItem().get( position - position_move).getDescr(); .......... } return convertView; } static class ViewHolder { TextView txt_description; TextView txt_time; TextView txt_title; TextView txt_place; } } When I do that, method `convertView.setBackgroundColor(Color.RED)` work great, what I need Image is there: [dl.dropbox.com/u/866867/stack/device2.png][1] but when I want to remove that item, I can't do it. I add there `convertView.setVisibility(View.GONE);` , but have empty item, beside hide it. I read that parameter `View.INVISIBLE` won't hide layout, but `View.GONE` have, but in my code, doesn't((( And that image: [http://dl.dropbox.com/u/866867/stack/device.png][2] [1]: http://dl.dropbox.com/u/866867/stack/device2.png [2]: http://dl.dropbox.com/u/866867/stack/device.png

以上就是BaseAdapter don't hide layout with setVisibility(View.GONE)的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏