UITabBarItem 颜色,字体大小修改

letattrsNormal:[NSAttributedStringKey:Any] = [

        .strokeColor : UIColor.black,

        .foregroundColor : UIColor.black,

        .font:UIFont.systemFont(ofSize:20)

    ]

    letattrsSelected:[NSAttributedStringKey:Any] = [



        .strokeColor : UIColor.red,

        .foregroundColor : UIColor.red,

        .font:UIFont.systemFont(ofSize:20) 

    ]



    UITabBarItem.appearance().setTitleTextAttributes(attrsNormal as [NSAttributedStringKey : Any], for: .normal)

    UITabBarItem.appearance().setTitleTextAttributes(attrsSelected as [NSAttributedStringKey : Any], for: .selected)

你可能感兴趣的:(UITabBarItem 颜色,字体大小修改)