Skip to content

Commit

Permalink
Merge pull request #6 from tarop/feature/fix-contentview-autolayout
Browse files Browse the repository at this point in the history
contentView の制約が topLayoutGuide になってなかった
  • Loading branch information
nakajijapan committed May 21, 2015
2 parents fc45f0e + e5b6309 commit be0aab8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Classes/NKJPagerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,13 @@ - (void)defaultSetUp
[self.delegate viewPagerDidAddContentView];
} else {
self.contentView.translatesAutoresizingMaskIntoConstraints = NO;
NSDictionary *views = @{ @"contentView" : self.contentView };
NSDictionary *views = @{
@"contentView" : self.contentView,
@"topLayoutGuide" : self.topLayoutGuide,
@"bottomLayoutGuide" : self.bottomLayoutGuide
};
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|-0-[contentView]-0-|" options:0 metrics:nil views:views]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-64-[contentView]-0-|" options:0 metrics:nil views:views]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[topLayoutGuide]-0-[contentView]-0-[bottomLayoutGuide]" options:0 metrics:nil views:views]];
}
}

Expand Down

0 comments on commit be0aab8

Please sign in to comment.