Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

satyam90

macrumors regular
Original poster
Jul 30, 2007
242
0
Bangalore, India
I am using ObjC with cocoa framework.
I have a table view with 4 columns. From IB I am able to center the text in columns horizontally. But how to centre the text "Vertically"
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,630
Western US
As far as I know, there's no way to set vertical cell contents alignment either in IB or programmatically, and there sure should be. I think two choices you might look at are using NSAttributedStrings for your cells and adjusting the baseline, or subclassing NSCell to override its drawInteriorWithFrame:inView: method. Either way you'll have to calculate the offset based on the text rectangle and the cell frame.
 

satyam90

macrumors regular
Original poster
Jul 30, 2007
242
0
Bangalore, India
I have NSArrayController with data (strings, date, image etc) available in it and I am binding my table columns to it. So neither I am using seperate NSCell nor I am using NSAttributedStrings...............
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.