Skip to content

Commit

Permalink
Change the layout behavior in MDCHeaderStack view to accommodate a to…
Browse files Browse the repository at this point in the history
…pBar with flexible height. (#4355)

Change the layout behavior in MDCHeaderStackView to accommodate a topBar with flexible height.

Internal testing of this PR is done in cl/198879834, and there is some discussion on b/79893968.

Closes https://github.com/material-components/material-components-ios/issues/4356
  • Loading branch information
Ali Rabbani authored and jverkoey committed Jun 5, 2018
1 parent de44925 commit 912bdcb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/HeaderStackView/src/MDCHeaderStackView.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ - (void)layoutSubviews {

CGSize boundsSize = self.bounds.size;

CGSize topBarSize = [_topBar sizeThatFits:boundsSize];
CGSize bottomBarSize = [_bottomBar sizeThatFits:boundsSize];

CGFloat remainingHeight = boundsSize.height - topBarSize.height - bottomBarSize.height;
CGFloat remainingHeight = boundsSize.height - bottomBarSize.height;
CGSize topBarSize = [_topBar sizeThatFits:CGSizeMake(boundsSize.width, remainingHeight)];
remainingHeight -= topBarSize.height;

CGRect topBarFrame = CGRectMake(0, 0, topBarSize.width, topBarSize.height);
CGRect bottomBarFrame = CGRectMake(0, 0, bottomBarSize.width, bottomBarSize.height);
Expand Down

0 comments on commit 912bdcb

Please sign in to comment.