0
我一直在试图设置一个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];
}
不过,我遇到了一些麻烦确定如何使它用户没有看到这个变化,这意味着当它旋转时,你会看到较大的图像变成一个较小的图像,我不想要这个,
有没有人知道如何使过渡更加用户友好?我也尝试过设置imageView didRotateFromInterfaceOrientation
的方法,并没有比这更好的了。