Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Tuesday, May 8, 2012
Default font size of UITableViewCell
Anybody knows the default font size of UITableViewCell?
You can always set any font to those labels in code so if you want some guaranteed fixed values you'd better do that as size values may vary depending on many factors (cell's style, sdk version, os version etc).
I've tested on simulator with 4.2 SDK version and got following results (no extra properties were set for cells):
This question was answered here by Vladimir.
ReplyDeleteHere's what he said:
You can always set any font to those labels in code so if you want some guaranteed fixed values you'd better do that as size values may vary depending on many factors (cell's style, sdk version, os version etc).
I've tested on simulator with 4.2 SDK version and got following results (no extra properties were set for cells):
UITableViewCellStyleSubtitle:
textLabel: Helvetica Bold, size: labelFontSize+1 (18 px)
detailsLabel: Helvetica, size: systemFontSize (14 px)
UITableViewCellStyleValue1:
textLabel: Helvetica Bold, size: labelFontSize (17 px)
detailsLabel: Helvetica Bold, size: systemFontSize+1 (15 px)
UITableViewCellStyleValue2:
textLabel: Helvetica Bold, size: smallSystemFontSize (12 px)
detailsLabel: Helvetica, size: labelFontSize (17 px)
UITableViewCellStyleSubtitle font size
[UIFont boldSystemFontOfSize:17.0];
ReplyDeleteWhich was discovered by changing the font of a UITableViewCell's textLabel until it matched the default.
If you look in the documentation for UIFont there are methods for retrieving system font sizes. I'd say they'll have you're answer.
ReplyDeletehttp://developer.apple.com/library/ios/#documentation/uikit/reference/UIFont_Class/Reference/Reference.html
+ labelFontSize is probably the one you're after.