我一直在寻找年龄并尝试了几个月。我永远不能让我的观点(任何观点)无效。这里有什么问题,谁能告诉我?谁能告诉我如何使用这些无效方法。提前致谢!
if(result.equals("true"))
{
View row = invoices.getChildAt(info.position);
//TextView bgr = (TextView) row.findViewById(R.id.status);
//bgr.setBackgroundResource(R.color.blue);
//row.setVisibility(View.GONE);
Animation anim = AnimationUtils.loadAnimation(Invoices.this, R.anim.down_to_top);
anim.setDuration(500);
invoices.getChildAt(info.position).startAnimation(anim );
final int row_pos = info.position;
new Handler().postDelayed(new Runnable() {
public void run() {
/*row.getInstance().remove(
FavouritesManager.getInstance().getTripManagerAtIndex(info.position)
);*/
ListView invoices = (ListView) findViewById(R.id.allInvoices);
View row = invoices.getChildAt(row_pos);
row.setVisibility(View.GONE);
getAllInvoices();
myAdapter.notifyDataSetChanged();
}
}, anim.getDuration());
Toast.makeText(getApplicationContext(), "Deleted!", Toast.LENGTH_SHORT).show();
}
更新:这就是我现在得到的。它删除了视图并正确设置了动画,但它仍然没有失效?
ListView invoices = (ListView) findViewById(R.id.allInvoices);
View row = invoices.getChildAt(row_pos);
HashMap<String, String> lRow = invoice_items.get(row_pos);
lRow.remove(row);
row.setVisibility(View.GONE);
myAdapter.notifyDataSetChanged();