view.setLayoutParams(new GridView.LayoutParams(100, 100));

如果父布局为Gridview 要用Gridview