완전한 답을 갖고 있지는 않지만 왜 첫 번째 행이 탐색 바 아래로 이동하는지 알지 못합니다. 추가 코드 나 스크린 샷을 제공해야 할 수도 있습니다. 최악의 경우 내가 중 하나의 tableview를 그룹화하고 정렬 할
-(CGFloat)tableView:(UITableView*)tableView heightForHeaderInSection:(NSInteger)section
또는 내가 끌어있는 tableview 이상에 인터페이스 빌더에서 객체에서 더미보기 드롭 것, 그런 식으로 첫 번째 행은 탐색 아래에 갈 수 없었다 바.
어쨌든 모든 행을 세로 및 가로로 표시해야하는 경우 방향 변경을 감지하고 행 높이를 작게 또는 크게 설정할 수 있습니다.
viewWillAppear 함수
-(void)viewWillAppear:(BOOL)animated{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil];}
배향 변화의 통보를 추가이 함수 께 방향에 따라
- (void)orientationChanged:(NSNotification *)notification{
[self.tableview reloadData];
}
변경 행 높이를 통지하고 배향
//row height
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown)
{
//portrait mode view
return 40.0; //play with the value according to your needs
}
else if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight)
{
//landscape view
return 30.0; //play with the value according to your needs
}
}
변화 할 때 열을 수축
질문을 편집하려고하면 따라하기가 어렵습니다. –
@SpaceDust. 나는 그것을 바꿨다. 그게 도움이 되니? – RookieAppler
은 탐색 모음 스택에서 가져온 탐색 모음입니다. 아니면 탐색 막대를보기로 드래그 했습니까? –