Closed zekunyan closed 6 years ago
https://github.com/alibaba/VirtualView-iOS/blob/4a96df7ce342690bade4499c7c0d42ecc1031ed8/VirtualView/LayoutView/VVRatioLayout.m#L170
如题,在计算有ratio的size时,Android是减去了margin才算的,iOS的没有,会导致两端不一致。
Android的源码:
// RatioLayout.java的249行 if (p.mLayoutRatio <= 0) { mFixDim += child.getComMeasuredHeightWithMargin(); } else { mFixDim += p.mLayoutMarginTop + p.mLayoutMarginBottom; }
后续会确认下 css 或者 flex 的规范,按照规范进行两端同步
release 1.2.2 已解决
https://github.com/alibaba/VirtualView-iOS/blob/4a96df7ce342690bade4499c7c0d42ecc1031ed8/VirtualView/LayoutView/VVRatioLayout.m#L170
如题,在计算有ratio的size时,Android是减去了margin才算的,iOS的没有,会导致两端不一致。
Android的源码: