在adapter的item布局中,LinearLayout下子v
2019-08-21 本文已影响0人
奔三路上的少年
在adapter的item中,当有LinearLayout的orientation为horizontal时(即横向布局),如有类似下列情况

当在adapter为textView进行赋值操作(即改变了控件的宽度),需调用view.requestLayout,否则此LinearLayout下其他子view的位置会不符合预期。这是因为adapter的重用机制导致的。