[iOS] Some images show question mark instead of actual icon
atereshkov opened this issue · comments
Including free icons of course. I use latest v1.9 version.
// Shows "?"
tabBarItem.image = UIImage.fontAwesomeIcon(name: .home, style: .regular, textColor: .black, size: CGSize(width: 28, height: 28))
// Shows actual icon
tabBarItem.image = UIImage.fontAwesomeIcon(name: .user, style: .regular, textColor: .black, size: CGSize(width: 28, height: 28))
Any ideas?
Ok seems like I get the issue. I need to check whether the icon style is free for use on the fontawesome.com.
Using .solid style for .home icon works for me:
tabBarItem.image = UIImage.fontAwesomeIcon(name: .home, style: .solid, textColor: .black, size: CGSize(width: 28, height: 28))
Ensure that you are also using the pro fonts, if you have them available.
Do this by setting FontAwesomeConfig.usesProFonts = true
somewhere in your initialization. I usually set it in the AppDelegate
I should also note that a limited number of free icons have regular styles available. Some of them only have solid. This appears to be the case with home
, but not user
Each icon has a property attached that will let you know what styles are available