ios7+ navigationbar的透明度怎么设置 如图所示,希望能做成:下滑tableview 渐显navigationbar的背景色navigationbar.alpha设置根本不起作用。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 回楼主,可以自定义一个UINavigationBar, 重写-initWithFrame:方法,将私有类_UINavigationBarBackground从navigationBar中删除,就能实现楼主想要的效果,且不影响navigationBar的正常功能,代码如下:- (instancetype)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { for (UIView *view in self.subviews) { if ([view isKindOfClass:NSClassFromString(@"_UINavigationBarBackground")]) { [view removeFromSuperview]; } } } return self;} 去掉_UINavigationBarBackground的遮盖效果后,楼主想怎么改变导航条的外观都轻而易举了,希望对您有所帮助。 实现UINavigationControllerDelegate,也不起作用吗self.navigationController.delegate =self;-(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated{ if (viewController == self) { self.navigationController.navigationBar.alpha = 0.300; }else{ self.navigationController.navigationBar.alpha =1; }} 设置背景色为 clearColor ios实现微博登录功能 [@"Hello" drawAtPoint] 如何设置字体颜色 iphone 开发入门指导 弱引用指向的对象释放,测试打印有疑问 管理从服务器下载的大量图片 IOS如何 获取周边搜索到的 Wi-Fi SSID? Xcode5中ios7模拟器出现 Cannot find executable for CFBundle ...**的解决办法 从零学习手机软件编程一般要多长时间? NSDictionary迭代 证书覆盖如何操作 请问project中的provisioning profile 究竟有什么用? 代码签名的整个流程
{
self = [super initWithFrame:frame];
if (self) {
for (UIView *view in self.subviews) {
if ([view isKindOfClass:NSClassFromString(@"_UINavigationBarBackground")]) {
[view removeFromSuperview];
}
}
}
return self;
}
self.navigationController.delegate =self;
-(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
if (viewController == self) {
self.navigationController.navigationBar.alpha = 0.300;
}else{
self.navigationController.navigationBar.alpha =1;
}
}