@@ -39,6 +39,7 @@ public class LinkagePicker<Fst extends LinkageFirst<Snd>, Snd extends LinkageSec
3939 protected float firstColumnWeight = 1.0f ;//第一级显示的宽度比重
4040 protected float secondColumnWeight = 1.0f ;//第二级显示的宽度比重
4141 protected float thirdColumnWeight = 1.0f ;//第三级显示的宽度比重
42+ protected boolean useWeight = true ;
4243 private OnPickListener onPickListener ;
4344 private OnLinkageListener onLinkageListener ;
4445 private OnWheelListener onWheelListener ;
@@ -166,6 +167,10 @@ public void setLabel(String firstLabel, String secondLabel, String thirdLabel) {
166167 this .thirdLabel = thirdLabel ;
167168 }
168169
170+ public void setUseWeight (boolean useWeight ) {
171+ this .useWeight = useWeight ;
172+ }
173+
169174 public Fst getSelectedFirstItem () {
170175 if (selectedFirstItem == null ) {
171176 //noinspection unchecked
@@ -273,6 +278,7 @@ protected View makeCenterView() {
273278 layout .setGravity (Gravity .CENTER );
274279
275280 final WheelView firstView = createWheelView ();
281+ firstView .setUseWeight (useWeight );
276282 firstView .setLayoutParams (new LinearLayout .LayoutParams (0 , WRAP_CONTENT , firstColumnWeight ));
277283 //firstView.setLabel(firstLabel);
278284 layout .addView (firstView );
@@ -283,6 +289,7 @@ protected View makeCenterView() {
283289 }
284290
285291 final WheelView secondView = createWheelView ();
292+ secondView .setUseWeight (useWeight );
286293 secondView .setLayoutParams (new LinearLayout .LayoutParams (0 , WRAP_CONTENT , secondColumnWeight ));
287294 //secondView.setLabel(secondLabel);
288295 layout .addView (secondView );
@@ -293,6 +300,7 @@ protected View makeCenterView() {
293300 }
294301
295302 final WheelView thirdView = createWheelView ();
303+ thirdView .setUseWeight (useWeight );
296304 if (!provider .isOnlyTwo ()) {
297305 thirdView .setLayoutParams (new LinearLayout .LayoutParams (0 , WRAP_CONTENT , thirdColumnWeight ));
298306 //thirdView.setLabel(thirdLabel);
0 commit comments