UITabBar appearance setSelectionIndicatorImage does not work on first launch iOS7

后端 未结 5 2274
你的背包
你的背包 2021-02-13 05:51

I have a customised UITabBar and use the following code in the AppDelegate:

- (void)tabBarController:(MainUITabBarController *)tabBarController didSelectViewCont         


        
5条回答
  •  囚心锁ツ
    2021-02-13 06:29

    - (void)customizeTabBar {
    
     UIImageView *customizeTabBar = [[UIImageView alloc]initWithFrame:CGRectMake(0,0,320.0,50)];
    customizeTabBar.image=[UIImage imageNamed:@"Tab_bar.png"];
    
    firstTab = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tab1.png"] highlightedImage:[UIImage imageNamed:@"tab11.png"]];
    [firstTab setFrame:CGRectMake(8.0,01.0,90.0,49.0)];
    [customizeTabBar addSubview: firstTab];
    
    secondTab = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tab2"] highlightedImage:[UIImage imageNamed:@"tab22"]];
    [secondTab setFrame:CGRectMake(115.0,01.0,90.0,49.0)];
    [customizeTabBar addSubview: secondTab];
    
    thirdTab = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tab3"] highlightedImage:[UIImage imageNamed:@"tab33"]];
    [thirdTab setFrame:CGRectMake(223.0,01.0,90.0,49.0)];
    [customizeTabBar addSubview: thirdTab];
    self.tabBar.tag=10;
    [self.tabBar addSubview:customizeTabBar];
    
    }
    

提交回复
热议问题