我在iPhone应用中有一个导航栏,其中包含自定义的UIBarButtonItems:
UIBarButtonItem* homePersonButton = [[UIBarButtonItem alloc]
initWithImage:[UIImage imageNamed:@"homePerson.png"]
style:UIBarButtonItemStylePlain
target:self action:@selector(showHomePerson)];
homePerson.png的尺寸为20 x 18。
在竖屏模式下看起来很好,但是在横屏模式下,按钮上的20x18的图像太高了,不太好看。看起来iOS会对他们的标准按钮进行一些处理,以便在较窄的导航栏中缩小图像。
最佳解决方案是什么?
另一个例子是当我有一个自定义按钮在导航栏的titleView中时。我需要它在应用程序旋转时也能缩小。
非常感谢您能给我任何指导!