@@ -1469,11 +1469,10 @@ -(void)layoutSubviews
1469
1469
}
1470
1470
1471
1471
if (self.endLayoutBlock != nil )
1472
- {
1473
1472
self.endLayoutBlock ();
1474
- self. beginLayoutBlock = nil ;
1475
- self.endLayoutBlock = nil ;
1476
- }
1473
+
1474
+ self.beginLayoutBlock = nil ;
1475
+ self. endLayoutBlock = nil ;
1477
1476
}
1478
1477
1479
1478
@@ -1531,7 +1530,7 @@ -(void)vertGravity:(MyMarginGravity)vert
1531
1530
{
1532
1531
1533
1532
pRect->origin .y = self.padding .top + topMargin;
1534
- pRect->size .height = [self validMeasure: sbv.heightDime sbv: sbv calcSize: selfSize.height - self .padding.bottom - bottomMargin - pRect->origin.y sbvSize: pRect->size selfLayoutSize: selfSize];
1533
+ pRect->size .height = [self validMeasure: sbv.heightDime sbv: sbv calcSize: selfSize.height - fixedHeight - bottomMargin - topMargin sbvSize: pRect->size selfLayoutSize: selfSize];
1535
1534
}
1536
1535
else if (vert == MyMarginGravity_Vert_Center)
1537
1536
{
@@ -1543,9 +1542,7 @@ -(void)vertGravity:(MyMarginGravity)vert
1543
1542
if (self.window != nil )
1544
1543
{
1545
1544
pRect->origin .y = (self.window .frame .size .height - topMargin - bottomMargin - pRect->size .height )/2 + topMargin + centerMargin;
1546
-
1547
- CGPoint pt = pRect->origin ;
1548
- pRect->origin .y = [self .window convertPoint: pt toView: self ].y ;
1545
+ pRect->origin .y = [self .window convertPoint: pRect->origin toView: self ].y ;
1549
1546
}
1550
1547
1551
1548
}
@@ -1554,10 +1551,6 @@ -(void)vertGravity:(MyMarginGravity)vert
1554
1551
1555
1552
pRect->origin .y = selfSize.height - self.padding .bottom - bottomMargin - pRect->size .height ;
1556
1553
}
1557
- else if (vert == MyMarginGravity_Vert_Top)
1558
- {
1559
- pRect->origin .y = self.padding .top + topMargin;
1560
- }
1561
1554
else
1562
1555
{
1563
1556
pRect->origin .y = self.padding .top + topMargin;
@@ -1597,9 +1590,7 @@ -(void)horzGravity:(MyMarginGravity)horz
1597
1590
if (self.window != nil )
1598
1591
{
1599
1592
pRect->origin .x = (self.window .frame .size .width - leftMargin - rightMargin - pRect->size .width )/2 + leftMargin + centerMargin;
1600
-
1601
- CGPoint pt = pRect->origin ;
1602
- pRect->origin .x = [self .window convertPoint: pt toView: self ].x ;
1593
+ pRect->origin .x = [self .window convertPoint: pRect->origin toView: self ].x ;
1603
1594
}
1604
1595
1605
1596
@@ -1609,10 +1600,6 @@ -(void)horzGravity:(MyMarginGravity)horz
1609
1600
1610
1601
pRect->origin .x = selfSize.width - self.padding .right - rightMargin - pRect->size .width ;
1611
1602
}
1612
- else if (horz == MyMarginGravity_Horz_Left)
1613
- {
1614
- pRect->origin .x = self.padding .left + leftMargin;
1615
- }
1616
1603
else
1617
1604
{
1618
1605
pRect->origin .x = self.padding .left + leftMargin;
@@ -1916,6 +1903,25 @@ -(CGFloat)validMargin:(MyLayoutPos*)pos sbv:(UIView*)sbv calcPos:(CGFloat)calcPo
1916
1903
return calcPos;
1917
1904
}
1918
1905
1906
+ -(BOOL )isNoLayoutSubview : (UIView*)sbv
1907
+ {
1908
+ return ((sbv.isHidden || sbv.absPos .sizeClass .isHidden ) && self.hideSubviewReLayout ) || sbv.useFrame ;
1909
+ }
1910
+
1911
+ -(NSMutableArray *)getLayoutSubviews
1912
+ {
1913
+ NSMutableArray *sbs = [NSMutableArray arrayWithCapacity: self .subviews.count];
1914
+ for (UIView *sbv in self.subviews )
1915
+ {
1916
+ if ([self isNoLayoutSubview: sbv])
1917
+ continue ;
1918
+
1919
+ [sbs addObject: sbv];
1920
+
1921
+ }
1922
+
1923
+ return sbs;
1924
+ }
1919
1925
1920
1926
1921
1927
- (void )alterScrollViewContentSize : (CGRect )newRect
0 commit comments