1, about Iconfont
Iconfont is both icon and font, in particular, it should be displayed in the form of a font icon. Unlike icons in traditional picture formats, this kind of icon is easy to change in size, color, and background color because it is displayed in font form.
2. How to use 2.1 Download resources
Resource Source: http://www.androidicons.com/
Follow the guide to find the download link. Download the decompression to find Iconfont/font, the inside of the four files copied to the Android project in the assets directory. Find glyphs/glyphs.html, because it will be used later, so it is also copied to the assets directory.
2.2 Adding icons
Here add TextView, button and other controls can, and then SetText () when the icon corresponding to the code as a parameter to pass in. For the icon corresponding to the code, you need to open glyphs.html, find the icon you want to add, copy the last line below, such as "& #59428;".
2.3 Setting fonts (Typeface)
Typeface icontypeface = Typeface.createfromasset (Getassets (), "Androidicons.ttf"= (TextView) Findviewbyid (R.id.iconview); Textview.settypeface (icontypeface);
Typeface.createfromassets () The first parameter is the Assetmanager object, which is obtained by Getassets (), and the second parameter is the path, as shown in the code as "Assets/androidicons.ttf".
Note: When I use eclipse, I don't see the added icon in the preview, only in the emulator, and I don't know if it's the eclipse itself.
Iconfont tips for using Android apps