0

コンテナ ビューを展開しようとしています。しかし、含まれている要素のサイズも変更されていない理由がわかりません...それらは元の基本サイズのままです。

これが私が試したことです(何か悪いことをしたか、それとももっと簡単にできるか教えてください)

[UIView animateWithDuration:1.5 
delay:0.0 usingSpringWithDamping:1
initialSpringVelocity:0
options:UIViewAnimationCurveLinear | UIViewAnimationOptionCurveLinear
animations:^{
        _heightConstraint.constant = [[UIScreen mainScreen] bounds].size.height;
        _widthConstraint.constant = [[UIScreen mainScreen] bounds].size.width;
        _posYConstraint.constant = -20;
        _posXConstaint.constant = 0;
        // I tried desperately the following mess :)
        for (UIView* i in _container.subviews) {
            [i layoutIfNeeded];
        }
        [_container layoutIfNeeded];
        [self.view layoutIfNeeded];
    } completion:nil];
4

1 に答える 1

1

フレームのサイズを変更しても、要素、つまりサブビューは変形しません。ビューの変換を変更する必要があり、それはすべてのサブビューの変換に適用されます。

<your view>.transform=CGAffineTransformMakeScale(2, 2);
于 2013-11-27T05:03:18.970 に答える