How do I change background color of UITabItem when item is selected

前端 未结 11 1088
暖寄归人
暖寄归人 2021-02-01 19:15

I would like a different background color when the user selects a tab bar item than when it is unselected.

11条回答
  •  逝去的感伤
    2021-02-01 19:54

    You can use tintcolor.

    [[UITabBar appearance] setSelectedImageTintColor:[UIColor redColor]];
    

    In AppDelegate.m, put the following code after // Override point for customization after application launch.

提交回复
热议问题