首页 > 代码库 > 怎样动态设置GridView的宽和高(Android)

怎样动态设置GridView的宽和高(Android)

1 LinearLayout.LayoutParams linearParams2 = (LinearLayout.LayoutParams)liveGrid.getLayoutParams();2         linearParams2.width=(shipin_Adapter.getCount())*(cWidth+hSpacing);3         linearParams2.height=cHight;4         liveGrid.setLayoutParams(linearParams2);

 

怎样动态设置GridView的宽和高(Android)