Do you know the debugger? He knows everything. To access the layout, try the following in gdb.
I set a breakpoint at - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath , which is called just before the cell is displayed
(note: there is a background image in my cell)
(gdb) po cell <UITableViewCell: 0x59e9920; frame = (0 66; 320 44); text = '396 Studio'; autoresize = W; layer = <CALayer: 0x59e9a00>> (gdb) po [cell subviews] <__NSArrayM 0x4eaf730>( <UIImageView: 0x59ea660; frame = (0 0; 320 100); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x59ea690>>, <UITableViewCellContentView: 0x59e9eb0; frame = (9 0; 302 44); layer = <CALayer: 0x59ea070>> ) (gdb) po [[[cell subviews] objectAtIndex:1] subviews] <__NSArrayM 0x4eaf700>( <UILabel: 0x59e9170; frame = (0 0; 0 0); text = '396 Studio'; clipsToBounds = YES; userInteractionEnabled = NO; layer = <CALayer: 0x59e91e0>>, <UITableViewLabel: 0x59e65c0; frame = (0 0; 0 0); text = 'Houston'; clipsToBounds = YES; userInteractionEnabled = NO; layer = <CALayer: 0x59e6690>> ) (gdb) po [0x59e9170 font] <UICFFont: 0x5e12610> font-family: "Helvetica"; font-weight: bold; font-style: normal; font-size: 0px (gdb) p (CGRect)[cell frame] $1 = { origin = { x = 0, y = 66 }, size = { width = 320, height = 44 } }
po = print object p = print, but you must specify the value in the form that, as you know,
no access to cell.frame resource - use objective-c methods [cell frame]
In addition, here is a 4-year-old but still useful article on iPhone fonts: a bold fireball .
bshirley
source share