2013-05-13 1 views
1

viewcontroller에서 하나의 프로젝트를 만들고 있습니다. 이미지보기, 레이블 및 scrollview이 있습니다. 그러나 오리엔테이션을 나쁜 방향으로 정렬하면 어떻게 바뀌나요?iOS 5.0에서 오리엔테이션 변경

올바르게 정렬 할 수있는 방법이 있습니까? 또한 내 scrollview 작동하지 않습니다. 대리인을 storyboard.my controll 프레임의 뷰로 설정했습니다 (가로 모드).

book_cover_image.frame=CGRectMake(50,20,250,300); 
    label_book_name.frame=CGRectMake(350,20,500,50); 
    label_book_author.frame=CGRectMake(350,76 , 500, 50); 
    label_book_price.frame=CGRectMake(350,135, 500, 50); 
    image_price_rupees.frame=CGRectMake(100, 330, 22, 16); 
    [buy_button setFrame:CGRectMake(13, 380, 119, 32)]; 
    [preview_button setFrame:CGRectMake(150, 380, 113, 32)]; 
    RecommendedBooksView.frame=CGRectMake(0,400,1024,368); 
    _thumbnailListView.frame=CGRectMake(15, 50, 950,350); 

답변

0

회전 중에보기의 크기와 위치를 자동으로 조정하려면 UIView의 autoresizingMask 속성을 사용하는 것이 좋습니다. autoresizingMask 당신이 원하는 것을 할 수없는 경우

http://www.techpaa.com/2012/05/understanding-uiview-autoresizing.html

, 당신은 구현하여 각 방향에 대한 프레임을 사용자 정의 할 수 있습니다 : 당신의 뷰 컨트롤러에서

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration { 
    [UIView animateWithDuration:duration animations:^{ 
     //set new frame properties 
    }]; 
} 

합니다.