2011-09-01 62 views

回答

-1

在一個String對象是沒有辦法修改字體,你應該嘗試使用一個UILabel。看看這個代碼:

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 50)]; 
label.text = yourString; //You can also use @"string" instead of an NSString 
label.textAlignment = UITextAlignmentCenter; 
label.textColor = [UIColor whiteColor]; 
label.font = [UIFont fontWithName:@"Helvetica-Oblique" size:(12.0)]; //Font ;) 
label.backgroundColor = [UIColor clearColor]; 

正如你可以看到有設置字體,FOT字體的列表中查找該網站的屬性:http://iosfonts.com/

+0

謝謝,但,是的,我知道,但是當我是我的標籤,我如何將它添加到我的註釋中? –

+0

我認爲你有看法,對吧?你可以簡單地使用[yourView addSubview:label]; –

+0

再看看標籤的CGRectMake –