Skip to content

Commit b44aa5d

Browse files
committed
处理子视图全部占据后的边界线不显示的问题,以及非布局父视图wrapContentSize布局视图的小优化。
1 parent ba8afd6 commit b44aa5d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

MyLayout/Lib/MyBaseLayout.m

+3-2
Original file line numberDiff line numberDiff line change
@@ -1994,13 +1994,13 @@ -(void)layoutSubviews
19941994

19951995
if (supv.wrapContentHeight)
19961996
{
1997-
superBounds.size.height = lsc.myTop + newSelfSize.height + lsc.myBottom;
1997+
superBounds.size.height = [self myValidMeasure:supv.heightSizeInner sbv:supv calcSize:lsc.myTop + newSelfSize.height + lsc.myBottom sbvSize:superBounds.size selfLayoutSize:newSelfSize];
19981998
superCenter.y += (superBounds.size.height - supv.bounds.size.height) * supv.layer.anchorPoint.y;
19991999
}
20002000

20012001
if (supv.wrapContentWidth)
20022002
{
2003-
superBounds.size.width = lsc.myLeading + newSelfSize.width + lsc.myTrailing;
2003+
superBounds.size.width = [self myValidMeasure:supv.widthSizeInner sbv:supv calcSize:lsc.myLeading + newSelfSize.width + lsc.myTrailing sbvSize:superBounds.size selfLayoutSize:newSelfSize];
20042004
superCenter.x += (superBounds.size.width - supv.bounds.size.width) * supv.layer.anchorPoint.x;
20052005
}
20062006

@@ -3308,6 +3308,7 @@ -(void)myUpdateBorderLayer:(CAShapeLayer**)ppLayer withBorderline:(MyBorderline*
33083308
if ( *ppLayer == nil)
33093309
{
33103310
*ppLayer = [[CAShapeLayer alloc] init];
3311+
(*ppLayer).zPosition = 10000;
33113312
(*ppLayer).delegate = self;
33123313
[_layout.layer addSublayer:*ppLayer];
33133314
}

0 commit comments

Comments
 (0)