Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 旋转主屏幕和旋转回子视图_Iphone_Ipad_Opengl Es_Core Animation - Fatal编程技术网

Iphone 旋转主屏幕和旋转回子视图

Iphone 旋转主屏幕和旋转回子视图,iphone,ipad,opengl-es,core-animation,Iphone,Ipad,Opengl Es,Core Animation,如何旋转基础视图并确保其子视图仍处于正确位置 -------- |X | After 90 degree rotate and stretch | | this should remain the same | | | Y| -------- 我想我需要旋转90度并根据窗口比例拉伸,然后在子视图上执行相反的操作 以下内容不起作用 - (void) performTransformation:(U

如何旋转基础视图并确保其子视图仍处于正确位置

--------                            
|X     |   After 90 degree rotate and stretch
|      |   this should remain the same
|      |
|     Y|
--------
我想我需要旋转90度并根据窗口比例拉伸,然后在子视图上执行相反的操作

以下内容不起作用

- (void) performTransformation:(UIView*)view isBase:(BOOL)isBase
{
    if(isBase) {
        [view.layer setAffineTransform:CGAffineTransformConcat(
            CGAffineTransformMakeRotation(M_PI * 0.5),
            CGAffineTransformMakeScale(-(3.0/4.0), (4.0/3.0)))];
    } else {
        [view.layer setAffineTransform:CGAffineTransformConcat(
            CGAffineTransformMakeScale(-(4.0/3.0), (3.0/4.0)),
            CGAffineTransformMakeRotation(-M_PI * 0.5))];
}

您是否正在旋转以响应设备的方向变化?如果是这样,可以使用的方法旋转视图

要执行所描述的操作,可以设置个人的属性。在您的示例中,您将执行以下操作:

[viewX setAutoresizingMask:(UIViewFlexibleRightMargin |
                            UIViewFlexibleBottomMargin )];

[viewY setAutoresizingMask:(UIViewFlexibleTopMargin |
                            UIViewFlexibleLeftMargin )];

该代码将设置第一个视图(我称之为
viewX
)保持在左上角,第二个视图保持在右下角。

不,我正在调整基础的大小,以便旋转UIView动画的效果。只要旋转和转换的是这些视图的超级视图,设置自动调整大小掩码应该有效。