我已经尝试了很多让UINavigationBar透明的东西.但我没有成功.我设置的图像是透明的.这是我的代码.
有帮助吗?
提前致谢.
有帮助吗?
提前致谢.
[rootNavC.navigationBar setBackgroundImage:[UIImage imageNamed:@"NAV_BG_iphone.png"] forBarMetrics:UIBarMetricsDefault]; rootNavC.navigationBar.translucent = YES; rootNavC.navigationBar.backgroundColor = [UIColor clearColor]; [[UINavigationBar appearance] setTitleTextAttributes:@{ UITextAttributeTextColor : [UIColor whiteColor],UITextAttributeTextShadowColor : [UIColor clearColor],UITextAttributeTextShadowOffset : [NSValue valueWithUIOffset:UIOffsetMake(0,0)],UITextAttributeFont : [UIFont fontWithName:@"pastel" size:20] }];
解决方法
试试这个
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; self.navigationController.navigationBar.shadowImage = [UIImage new]; self.navigationController.navigationBar.translucent = YES; self.navigationController.view.backgroundColor = [UIColor clearColor];
我希望上面的代码有所帮助.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。