[英]How to erase things from tablelayout?
我在应用程序中使用了Tablelayout,并添加了一些TableRows。 而且我想每次按按钮删除之前添加的TableRows。这怎么可能?
行=(TableRow)findViewById(R.id.row); table.removeView(row);
TableLayout tblLayout = (TableLayout) findViewById(viewID);
tblLayout.removeAllViews();
一种简单的方法是将行设置为消失。
TableLayout tableLayout = findByViewId(R.layout.myTL);
tableLayout.getChildAt(numberOfRow).setVisibility(View.GONE);
希望此解决方案适合您的情况!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.