2
.UItabbarContoller


//탭 아이템 글자 색깔 지정

[UITabBarItem.appearance setTitleTextAttributes:

@{NSForegroundColorAttributeName : [UIColor whiteColor]} forState:UIControlStateNormal];

 

[UITabBarItem.appearance setTitleTextAttributes:

     @{NSForegroundColorAttributeName : [UIColor colorWithRed:0/255.0f green: 162/255.0f blue:154/255.0f alpha:1.0]}

                                           forState:UIControlStateSelected];

if ([[[UIDevice currentDevicesystemVersionfloatValue] >= 7) {

        for (UITabBarItem *tbi in self.tabBarController.tabBar.items) {

            tbi.image = [tbi.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

        }

}



}


//탭 초기화



UINavigationController
 *mainNavCon = [[UINavigationController alloc]initWithRootViewController:mainView];

    [mainNavCon popViewControllerAnimated:YES];

    mainNavCon.navigationBarHidden = YES;

       

    

    UIImage *homeImg = [UIImage imageNamed:@"icon_home"];

       

    mainNavCon.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"" image:homeImg tag:0];

      

    tabBarController.viewControllers = @[mainNavCon,myVocaNavCon, recentNavCon, GroupNavCon, settingNavCon];

    //탭 백그라운드이미지설정

    [[UITabBar appearancesetBackgroundImage:[UIImageimageNamed:@"bar_menu"]];

    

    tabBarController.tabBar.translucent = true// 탭바투명도 설정

    

[[UITabBar appearance]setTintColor:[UIColor colorWithRed:0/255.0f green:162/255.0f blue:154/255.0f alpha:1.0]];

  

[[UITabBar appearancesetSelectionIndicatorImage:[UIImage imageNamed:@“icon_cover"]]; //탭 선택시 인디케이트 이미지


//탭선택하기


self.tabBarController.selectedIndex = 0;



WRITTEN BY
arcjeen
ios 관련문의 slimforce@naver.com

,