How to vertically center detail text in a table cell of UITableViewCellStyleValue2 style?

When I do

cell.textLabel.numberOfLines = 2;
cell.detailTextLabel.numberOfLines = 1;

on a cell of UITableViewCellStyleValue2 style, the line of detail text is top-aligned, i.e. roughly at the same vertical position as the first line of (main) text is. However, I want it to be in the vertical center of the cell. Setting cell.detailTextLabel.baselineAdjustment to various values did not help. Can anyone help?

Answers


Create the custom cell with these two label and set detailtextLabel(custom) frame as your want.


Need Your Help

Login with Email/GMail in ios

ios

I want to add "Login with Email" functionality in ios app.

Present view from delegate modally in iOS 5

iphone ios ios5

I cannot seem to find this anywhere online. I have an add button in one of my views and I have hooked it up to an IBAction method called add. In my storyboard, I have created a view that has a fo...