Ios 着色自定义UtiAbaritem
在我的iPad应用程序中,我有自定义的Ios 着色自定义UtiAbaritem,ios,objective-c,cocoa-touch,ios7,appdelegate,Ios,Objective C,Cocoa Touch,Ios7,Appdelegate,在我的iPad应用程序中,我有自定义的uitabaritem图像。我设置了选中和未选中的图标。选定图标为红色,未选定图标为红色图标的轮廓,但为灰色。当拉出UIModalPresentationSheet时,应用程序的默认行为是将背景以及条形按钮项和视图染成灰色。但是,活动的选项卡栏项仍为彩色。当我使用默认选项卡栏项目时,它会自动着色为灰色。当模式视图处于活动状态时,如何对自定义选项卡栏项着色以匹配背景中的所有其他内容 以下是我用来使用自定义图像的内容: appdelegate.m - (BOOL
uitabaritem
图像。我设置了选中和未选中的图标。选定图标为红色,未选定图标为红色图标的轮廓,但为灰色。当拉出UIModalPresentationSheet
时,应用程序的默认行为是将背景以及条形按钮项和视图染成灰色。但是,活动的选项卡栏项仍为彩色。当我使用默认选项卡栏项目时,它会自动着色为灰色。当模式视图处于活动状态时,如何对自定义选项卡栏项着色以匹配背景中的所有其他内容
以下是我用来使用自定义图像的内容:
appdelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOption {
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
UITabBar *tabBar = tabBarController.tabBar;
UITabBarItem *home = [tabBar.items objectAtIndex:0];
home.selectedImage = [[UIImage imageNamed:@"home-active.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
home.image = [[UIImage imageNamed:@"home-inactive.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}
我认为UI外观API能够满足您的需要,并可以在本教程中找到定制UITabbar的方法