获取屏幕宽度
获取将要布局的列数
宽度/列数 =每一列的宽度
考虑每一列的左右间距,进行优化
1.android:layout_height="wrap_content"2.layout.addView(progressBar, new LayoutParam(LayoutParam.FILL_PARENT, LayoutParam.FILL_PARENT));参考看看就知道了吧