Cannot resize linear layout children in android react native module

前端 未结 4 870
清酒与你
清酒与你 2021-02-13 21:31

Full code here

Video of correct behavior in java and incorrect in react native here

I have modified a linear layout to respond to touch by resizing the left chil

4条回答
  •  别跟我提以往
    2021-02-13 21:46

    LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) leftView.getLayoutParams();
    lp.width=newWidth;
    leftView.setLayoutParams(lp);
    leftView.requestLayout(); 
    

    Above code will solve you problem.

提交回复
热议问题