views:

35

answers:

1

can someone help me with text alignment to the right in my uitableview sections ?

the defult alignment is left. if the only way is to build custom header i will appreciate for code example.

A: 

Have you tried adding

cell.textLabel.textAlignment = UITextAlignRight;

to tableView:cellForRowAtIndexPath:?

As long as you are using cell.textLabel.text, and not the deprecated cell.text to set the text of the cell, this should work.

edit:

Sorry, I didn't catch that you were trying to do this with the section headers. I think you're going to have to roll your own header views, and return them using the UITableView delegate method -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;

Could take some work to get them to look like the default ones. Here is an example of someone describing how to theme the section headers: http://iphoneinaction.manning.com/iphone_in_action/2009/07/beauti.html

Kenny Winker
this will change the text in the cells what i am talking is the sections text between the cells.
Amir
Amir: edited answer, hope that helps.
Kenny Winker