自定义导航控制器工具栏比iPhone底部高一个像素

时间:2013-08-31 11:44:37

标签: iphone ios objective-c

我必须自定义UIViewController并使用以下代码来自定义底部的UIViewController工具栏

[self.navigationController.toolbar setBackgroundImage:[UIImage imageWithCGImage:[UIImage imageNamed:@"List/footer.png"].CGImage scale:2 orientation:UIImageOrientationDown] forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];
    [self.navigationController.toolbar setShadowImage:[UIImage imageNamed:@"transparent.png"] forToolbarPosition:UIToolbarPositionAny];
    [self.navigationController.toolbar setBackgroundColor:[UIColor clearColor]];

enter image description here

在屏幕截图中很明显,自定义工具栏下有一个白色像素。 如何删除像素?

1 个答案:

答案 0 :(得分:1)

这是一个简单的答案,但我有很多次相同的情况:)尝试控制图像 List / footer.png 它可以有1px透明底部本身?

另一种情况是在iOS项目中我从未给出像 List /

这样的路径

另外我的建议是,如果你想给阴影不要使用图像而不是使用QuartzCore框架和layer.shadow。

相关问题