0
でscrollViewDidScroll方法に変更した後に更新されない私は、ストーリーボードに接続されIBOutlet NSLayoutConstraintプロパティを持っている:NSLayoutConstraint iOS7
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *titleViewTopConstraint;
スクロールビューがスクロールをしたとき、私はscrollViewDidScroll方法でこの制約を変更します。
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat yOffset = scrollView.contentOffset.y;
if (yOffset <= -20) {
[self.logoView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(@(yOffset));
make.height.equalTo(@(fabs(yOffset) + self.ImageHeight + STATUSBAR_HEIGHT))}];
}
CGFloat top = self.ImageHeight - self.titleView.height - yOffset - 20;
self.titleViewTopConstraint.constant = top;
if (self.titleViewTopConstraint.constant < 25) {
self.titleViewTopConstraint.constant = 25;
}
}
スクロールビューがスクロールしたときに定数を更新しようとしていて、iOS8で正常に動作しています。しかし、定数はiOS7の設定後に更新されていないようです。
何がこの問題を引き起こす可能性があり、どのように解決できますか?ありがとう。