IOS development-use FontAwesome (icon, font)

Source: Internet
Author: User

First, introduce FontAwesome.

Font Awesome is an icon Font designed for Twitter Bootstrap. Some icons are displayed in the Web Font mode. The advantage is that the icons can be scaled or changed at will. All you need to do is modify the icon style like modifying the text style.

<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> Response + response/response + CjxwPsTH1Nppb3O/response + response/b3pydzSu8/CoaM8L3A + response + CjxwPtCnufvI58/Co7o8L3A + response = "http://www.2cto.com/uploadfile/Collfiles/20140311/20140311085610150.gif" alt = "\">

1. Extract the NSString + FontAwesome. h/. m file from the demo and import the FontAwesome. ttf font file to your project.

2. Create a new column (Fonts provided by application) in the. plist configuration file and add the FontAwesome. ttf element. (If you do not understand it, You can include the plist file in the demo)

3. Add the header file

# Import "NSString + FontAwesome. h"


4. Add such statements as needed.

[Button_2 setTitle: [NSString stringWithFormat: @ "% @ Delete", iconString] forState: UIControlStateNormal]; [button_2.titleLabel setFont: [UIFont fontWithName: @ "FontAwesome" size: 14];

In this way, you can use the icons provided by FontAwesome.


For details, see the code I gave.

In addition, the two online instances of mark have good results.

Http://code4app.com/ios/fontawesome/50f01ff26803fa706e000000 #


Http://code4app.com/ios/UIButton-Bootstrap/52635e8c6803fa576b000000


On the way to learning, I will share with you.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.