2013-06-20 111 views
3

我有問題。我有動態桌面視圖。所以我需要在textLabel中更改文本大小。 我想:如何更改UITableView中的textlabel大小

之一:

cell.textLabel.font = [UIFont systemFontOfSize:30.0f]; 

二:

cell.textLabel.font = [UIFont boldSystemFontOfSize:12.0]; 

三:

UIFont *myFont = [ UIFont fontWithName: @"Arial" size: 30.0 ]; 
cell.textLabel.font = myFont; 

但我爲textLabel不改變。所以detailtextlabel - 完全改變,但文本標籤 - 沒有。我做錯了什麼?感謝

+0

你確定你設置的'textLabel'之後的文本? – Alexander

+0

wats detailtextlabel ?? – IronManGill

+0

詳細文本標籤 - 它是標準文本在tableview中的例子描述... – Genevios

回答

5

您可以用下面的嘗試..

,但要確保你的U設置你的文字

[email protected]"Your TEXT Goes Here"; 

UIFont *myFont = [ UIFont fontWithName: @"Arial" size: 18.0 ]; 
cell.textLabel.font = myFont; 

希望它能幫助前編寫代碼。

+0

我粘貼此代碼之前... static NSString * CellIdentifier = @「Cell」; UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 如果 { 細胞= [[ALLOC的UITableViewCell] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier](細胞!); } cell.textLabel.text = @ 「在此輸入文字」; UIFont * myFont = [UIFont fontWithName:@「Helvetica」size:11.0]; cell.textLabel.font = myFont;但沒有什麼 – Genevios

+0

等待讓我試試你的代碼..然後告訴你 –

+0

okey我等待謝謝! – Genevios

相關問題