我设置了一个比导航栏稍大的背景图像。图像高度为 55 像素。[我想要一个带有导航栏底部的带状横幅的图像] 它在 iOS6 中工作正常。但是在 iOS7 中,它会被自己剪掉。我尝试设置 [self.navigationController.navigationBar setClipsToBounds:NO];
它仍然被剪辑。我不能有更大的背景图像而不会被剪裁吗?
我设置了一个比导航栏稍大的背景图像。图像高度为 55 像素。[我想要一个带有导航栏底部的带状横幅的图像] 它在 iOS6 中工作正常。但是在 iOS7 中,它会被自己剪掉。我尝试设置 [self.navigationController.navigationBar setClipsToBounds:NO];
它仍然被剪辑。我不能有更大的背景图像而不会被剪裁吗?
this is due to Ui navigation bar is 64 point in ios7 that why this create problem. refer this link https://developer.apple.com/library/ios/documentation/userexperience/conceptual/transitionguide/Bars.html refer table 5-1 that is give you idea that for resizable image what are the change in new ios7
you can use UIBarPositioning propety to solve your problem not sure but that may help you refer this link for more info related to UIBarPositioning
Edited also try by set this flag navigationBar.translucent = NO;
for more info refer this link iOS 7 UINavigationBar - UIView layout issue
将导航栏的委托设置为您的视图控制器,并UIBarPositionTopAttached
在委托方法中返回。返回你想看的位置
- (UIBarPosition)positionForBar:(id<UIBarPositioning>)bar
图像没有被剪裁,它很可能太小了。UINavigationBar 在 iOS 7 中是 64 点,所以 55px 的图像会太小,特别是考虑到需要 128px 的视网膜分辨率。