タブバーが透明な (または透明に見える) アプリを作成しようとしています。このために、ビューで画像の一部を使用しています。そして残りの部分をタブバーの背景に設定します。問題は、タブ バーが暗い色合いで表示されることです。私は今、アイデアがありません。以下はスクリーンショットです
UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tabbar_bg.png"]];
self.tabBar.backgroundColor=[UIColor whiteColor];
[self.tabBar insertSubview:imgView atIndex:1];
// [self.tabBar setSelectionIndicatorImage:[UIImage imageNamed:@"transp.png"]];
// [self.tabBar setSelectedImageTintColor:[UIColor clearColor]];
[[UITabBar appearance] setTintColor:[UIColor clearColor]];
[[UITabBar appearance] setSelectedImageTintColor:[UIColor clearColor]];
[[UITabBar appearance] setSelectionIndicatorImage:[UIImage imageNamed:@"transp.png"]];
viewDidLoad
上記は、カスタムUITabBarController
クラスで試したコードです。「tabbar_bg.png」はタブ バーの背景として使用される画像で、「transp.png」は selectionIndicator 画像として使用される透明な画像です。
助けてくれてありがとう。