2012-01-25 15 views
0

UIScrollViewを使用して画像のギャラリーを表示するアプリケーションを開発すると、画像間のスライドはポートレートモードで正常に機能しますが、横長モードに変更すると画像と次の画像の一部が表示されます。 もし私がこの問題を解決する方法についていくつかの説明を得ることができたら、私は非常に感謝します。風景モードのサイズ変更

+0

あなたはいくつかのコードを投稿する必要があります... – sergio

+0

あなたは幅と高さを調整する必要があるとの間隔の間で動的にサムネイルを表示します。これは一般的な概念ですが、@ sergioが述べたように、さらに助けが必要な場合は、いくつかのコードを投稿する必要があります。 – Canopus

答えて

0

UIScrollViewとその親ビューの右端がUIViewAutoResizingautoResizesSubViewsの値であることを確認してください。

そして、デバイスの向きの変更をリッスンし、適切な措置をとる(= scrollviewのサブビューを再配置)

-(void)applicationDidFinishLaunching:(UIApplication *)application { 
    // ... other things 

    [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; 
    [[NSNotificationCenter defaultCenter] addObserver:self 
       selector:@selector(didRotate:) 
       name:@"UIDeviceOrientationDidChangeNotification" object:nil]; 
}; 

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

    if (orientation == UIDeviceOrientationLandscapeLeft) { 
     NSLog(@"Landscape Left!"); 
    } 
} 
関連する問題