ユーザーが横向きから縦向きモードに回転したときに変更が表示されることなく、imageViewを設定しようとしました。
メソッドではwillAnimateRotationToInterfaceOrientation
、画像を適切な画像に再設定します (横向きモードか縦向きモードかによって異なります)。
if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation)) {
NSLog(@"Going to Portrait Mode.");
UIImage *footerImage = [UIImage imageNamed:@"SchoolImageLandscape.png"];
UIImageView *fView = [[UIImageView alloc] initWithImage:footerImage];
[self.tableView setTableFooterView:fView];
} else if (UIInterfaceOrientationIsPortrait(toInterfaceOrientation)) {
NSLog(@"Portrait Mode");
UIImage *footerImage = [UIImage imageNamed:@"SchoolImage.png"];
UIImageView *fView = [[UIImageView alloc] initWithImage:footerImage];
[self.tableView setTableFooterView:fView];
}
ただし、ユーザーに変更が表示されない場所を作成する方法を判断するのに苦労しています。回転すると、大きな画像が小さな画像になることがわかります。私はこれをしたくありません。
移行をよりユーザーフレンドリーにする方法を知っている人はいますか? imageViewdidRotateFromInterfaceOrientation
メソッドの設定も試してみましたが、改善されませんでした。