2010-04-16 54 views
2

使用UITableViewCellStyleValue2時,哪個標籤是detailTextLabel,哪個是textLabel?小的藍色文字或較大的黑色文字?UITableView Cell Text AlignmentdetailTextLabel vs textLabel

我想我的textLabel(黑色文本)是正確對齊的,所以我試過這個,但沒有成功。

cell.textLabel.textAlignment = UITextAlignmentRight; 
cell.detailTextLabel.textAlignment = UITextAlignmentRight; //tried this just in case, but no luck. 

爲什麼我的單元格不能正確對齊?我正在使用UITableViewCellStyleValue2

回答

2

textLabel是較大的藍色文本,而detailTextLabel是較小的黑色文本。 UITableViewCellStyleValue2集合textLabel左對齊和detailTextLabel右對齊。

如果要對樣式進行細化控制,則可以訪問contentView並創建子視圖以添加到該視圖。