「Objective-C」ios開発でNavigationBarを透明にする方法のまとめ

方法1
if ([self.navigationController.navigationBarrespondsToSelector:@selector( setBackgroundImage:forBarMetrics:)]){
NSArray *list = self.navigationController.navigationBar.subviews;
for (id objin list) {
if ([obj isKindOfClass:[UIImageViewclass]]) {
UIImageView *imageView = (UIImageView *)obj;
imageView.hidden = YES;
}
}
}

方法2
[self.navigationController.navigationBar setShadowImage:[UIImage new]];

IOS

Posted by arkgame