特定のコードを使用して、ナビゲーション バーを透明にしています。しかし、ツールバーのようにナビゲーションバーの下にあるビューをシフトしていて、ナビゲーションバーのタイトルと一致しています。
コードは次のとおりです。
(void)SetNavigationBarTransparent:(UINavigationController *)navicon{
NSLog(@"the navigation bar in app delegate is %@", navicon);
// these lines are for making the navigation bar transparent and making it submersible
with the view below it.
navicon.navigationBar.translucent = YES; // Setting this slides the view up, underneath
the nav bar (otherwise it'll appear black)
const float colorMask[6] = {222, 255, 222, 255, 222, 255};
UIImage *img = [[UIImage alloc] init];
UIImage *maskedImage = [UIImage imageWithCGImage:
CGImageCreateWithMaskingColors(img.CGImage, colorMask)];
[navicon.navigationBar setBackgroundImage:maskedImage forBarMetrics:UIBarMetricsDefault];
//remove shadow
if ([navicon.navigationBar respondsToSelector:@selector(shadowImage)])
{
[navicon.navigationBar setShadowImage:[[UIImage alloc] init]];
}
}
すべてのバー ボタンとタイトルがそのまま表示された状態でバーを確実に透明にしたいので、ビューが上に移動しないようにするにはどうすればよいでしょうか。
どんな助けでも大歓迎です。ありがとう!
ビューの自動サイズ変更は次のとおりです。
その場所にとどまるためにここで何ができるでしょうか。