2009-04-20 12 views
4

Mit the following post konnte ich ein UILabel zu einem UIToolbar hinzufügen, sieht aber beschissen aus. Weiß jemand, wie man Textgröße/-farbe/-schatten an den Titel eines UINavigationControllers anpasst?Wie bekomme ich die UIToolbar Schriftart mit UINavigation Controller übereinstimmen?

Navigation Controller

alt text http://www.codingwithoutcomments.com/uploads/Picture1.png

UIToolbar mit UILabel

alt text http://www.codingwithoutcomments.com/uploads/Picture2.png

Welche Schritte muss ich nehmen sie passen zu machen?

+0

Möchten Sie die Schrift Spezifikationen des Apple UIToolbar oder einfach nur, wie man wissen wollen Setze die Schriftart und Farbe eines UILabel? –

+0

Ich habe meine Frage geändert. Änderungen sehen – CodingWithoutComments

+0

Ich glaube, ich habe mich gefragt, ob jemand die Schrift- und Farbspezifikationen für ein UILabel kennt, die mit der Schriftart und den Farbspezifikationen des Navigation Controllers für "Artikel" übereinstimmen. – CodingWithoutComments

Antwort

7

Sie möchten vielleicht auch einen Schatten hinzufügen?

itemLabel.shadowColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5]; 
itemLabel.shadowOffset = CGSizeMake(0, -1.0); 
0
UILabel * itemLabel = [[UILabel alloc] initWithFrame:rectArea]; 
itemLabel.text = @"Item"; 
itemLabel.textColor = [UIColor whiteColor]; 
itemLabel.font = [UIFont boldSystemFontOfSize:22.0]; 
3

Offensichtlich ist die Frage über das iPhone ist, aber falls jemand fragt, hier sind die Zahlen für iPad:

titleLabel.font = [UIFont boldSystemFontOfSize:20.0]; 
    titleLabel.shadowOffset = CGSizeMake(0, 1); 
    titleLabel.shadowColor = [UIColor colorWithWhite:1.f alpha:.5f]; 
    titleLabel.textColor = [UIColor colorWithRed:113.f/255.f green:120.f/255.f blue:127.f/255.f alpha:1.f]; 
    titleLabel.backgroundColor = [UIColor clearColor]; 
    titleLabel.text = @"Title";