0
方向が変更されたときにUINavigationBar titleviewコンテンツイメージのサイズを変更する最適な方法は何ですか? 高さが44px、画像サイズが32pxの画像が1つあり、回転後にtitleviewを変更して新しい画像ビューを設定します。しかし、自動マスクやその他のトリックで何らかの結果を得る別の方法がありますか?UINavigationBar title異なる向きのビュー
方向が変更されたときにUINavigationBar titleviewコンテンツイメージのサイズを変更する最適な方法は何ですか? 高さが44px、画像サイズが32pxの画像が1つあり、回転後にtitleviewを変更して新しい画像ビューを設定します。しかし、自動マスクやその他のトリックで何らかの結果を得る別の方法がありますか?UINavigationBar title異なる向きのビュー
デバイスを回転させたときautoresizingMaskは、ビューのフレームのサイズを変更することができますが、2枚の異なる画像を切り替えたい場合は回転が発生したとき、あなたがwillAnimateRotationToInterfaceOrientation:duration:
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration
{
[super willAnimateRotationToInterfaceOrientation:interfaceOrientation duration:duration];
if (interfaceOrientation == UIDeviceOrientationLandscapeRight || interfaceOrientation == UIDeviceOrientationLandscapeLeft) {
// landscape
[imageView setImage:landscapeImage];
} else {
// portrait
[imageView setImage:portraitImage];
}
}
でプログラムにそれを行う必要があるでしょうどのような方法が最善でパフォーマンスに影響しませんか?自動サイズ変更マスクを使用してイメージビューフレームのサイズを変更するか、イメージを変更しますか? – taffarel