Scrollview设置内容左对齐

时间:2013-06-17 17:29:38

标签: ios objective-c xcode cocoa-touch uiscrollview

我在iOS-App-Project中有一个包含两个UIImages的scrollview。在纵向设备模式中,UIImages垂直排列。这是正确的,但是当我以横向模式旋转设备时,UIImages也垂直排列。但这就是我的问题......我想横向排列它们。我尝试使用pagingEnabled或contentMode但它不起作用。

我喜欢通过实际设备模式更改ScrollView的contentMode:

- (void)didRotate:(NSNotification *)notification {
    UIDeviceOrientation orientation = [[notification object] orientation];

    if (orientation == UIDeviceOrientationLandscapeLeft) {
        NSLog(@"Querformat-Links");
    } else if (orientation == UIDeviceOrientationLandscapeRight) {
        NSLog(@"Querformat-Rechts");
    } else if (orientation == UIDeviceOrientationPortraitUpsideDown) {
       NSLog(@"Hochformat-180 Grad");
    } else if (orientation == UIDeviceOrientationPortrait) {
        NSLog(@"Hochformat");
    }
}

-ScollView
- UIImage
- UIImage

感谢您的帮助!

对不起我的英语错误:)我来自德国。

0 个答案:

没有答案