我希望我的 UIImageView 在我旋转设备时变成全屏。我怎样才能做到这一点?
			
			1256 次
		
3 回答
            3        
        
		
在您的视图控制器中实现willAnimateRotationToInterfaceOrientation:...并根据方向为图像视图设置所需的框架:
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation) {
         self.imageView.frame = ...
    } else {
         self.imageView.frame = ...
    }
}
    于 2012-08-10T07:35:54.880   回答
    
    
            0        
        
		
并且不要忘记将您的设置autoresizingMask为这样的:
self.imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
如果您这样做,您不必自己关心框架调整。
干杯
于 2012-08-10T07:40:25.547   回答
    
    
            -1        
        
		
将 uiimageview.frame 设置为 widow.view.frame,并选择缩放以适应模式
于 2012-08-10T07:35:35.027   回答