iOS: FontAwesome-Symbol mit Titel in UIBarButtonItem und Button @ anhäng

Ich möchte ein UIBarButton-Objekt wie dieses in meiner Navigationsleiste und

Normal UIButton gefällt das

Ich habe bereits versucht, diese Links zu verwendenFrage Frage Frage aber nicht die Ausgabe bekommen.

Ich muss das FontAwesome-Symbol mit dem Titel der Schaltfläche anhängen.

Kann mir jemand dabei helfen?

Mein Code ist:

NSString *icon = [NSString fontAwesomeIconStringForIconIdentifier:@"fa-folder-open"];

NSString *locationString = [NSString stringWithFormat:@"%@ %@", icon, @"Change"];

NSMutableAttributedString *astring = [[NSMutableAttributedString alloc] initWithString:locationString];

[astring addAttribute:NSFontAttributeName
                value:[UIFont iconicFontOfSize:20]
                range:NSMakeRange(0,1)]; // The first character

changeFolderButton.titleLabel.attributedText = astring;

Antworten auf die Frage(6)

Ihre Antwort auf die Frage