Android GridView使用View.GONE只隐藏内容而不隐藏空间(动态设置LinearLayout宽高) 获取到LinearLayout,l_layout是该线性布局的id LinearLayout l_layout = (LinearLayout) findViewById(R.id.l_layout); l_layout.setLayoutParams(new LinearLayout.LayoutParams(0, 0));