2012-01-18 14 views
0

배경 이미지가있는 내 tableview에서 사용자 정의 셀을 사용하고 있습니다. 방향이 바뀌지 않는 셀 방향이 변경되면 방향 변경시 자동으로 사용자 정의 셀 크기를 변경해야합니다. 어떻게하면됩니까?UItableview 사용자 정의 셀의 너비를 변경

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 

당신은 YES의 shouldAutorotateToInterfaceOrientation 방법, 아니 그냥 반환해야합니다

+0

u 셀을 xib로 만들고 autoresize를 사용하는 경우. 다른 현명한 프레임을 다시 설정하십시오. – Ron

답변

1

당신은 위임에 프로그래밍 방식의 tableview 프레임을 설정할 수 있습니다 y라면 프레임 을 설정해야합니다. 우리 수업은 UITableViewController입니다.

// Override to allow orientations other than the default portrait orientation. 
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    // Return YES for supported orientations 
    return YES; 
} 
0

을 즐길 수

[tableView setFrame:[self.view.frame]]; 

사용할 수 있습니다 -

관련 문제