2009-04-20 44 views
4

使用the following post,我能夠將一個UILabel添加到UIToolbar,但它看起來很糟糕。任何人都知道如何獲得文本大小/顏色/陰影以匹配UINavigationController的標題?如何獲得UIToolbar字體以匹配UINavigation Controller?

導航控制器

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

UIToolbar用的UILabel

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

我需要什麼樣的步驟來使它們相匹配?

+0

你想知道蘋果UIToolBar的字體規格或只是如何設置UILabel的字體和顏色? – 2009-04-20 17:52:23

回答

7

您可能還想添加陰影嗎?

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

明顯的問題是關於iPhone,但如果你想知道,這裏的數字爲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";