我有一个EditText
.ImageView Plus
单击
ImageView Plus
我正在用EditText
和膨胀新布局ImageView Minus
。现在,单击
ImageView Minus
. 我想删除膨胀的布局。这个怎么做?ArrayList<View> viewList; /* Inflating new Layout */ case R.id.ivPlus: LayoutInflater layoutInflater = (LayoutInflater) getBaseContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); addView = layoutInflater.inflate(R.layout.add_edit, null); viewList.add(addView); ll.addView(addView); break; /* Removing the inflated layout */ for (int i = 0; i < viewList.size(); i++) { final int j = i; ImageView minus= (ImageView ) viewList.get(j).findViewById(R.id.ivMinus); minus.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { LinearLayout extra_add = (LinearLayout) findViewById(R.id.lin_add); extra_add.removeViewAt(j); } }); }