I want to create a UITableViewCell
that is very similar to the standard UITableViewCell
with the UITableViewCellStyleSubtitle
. The user is able to select a cell and the a checkmark should be set on that selected cell.
I want to display a UILabel
instead of the UIImage
in the left part of the cell. I have tried to add a UILabel
to the contentView
. The UILabel
is displayed above both the text and the detailed text label. I would like to move both the text and the detailed text to the right when my the UILabel
expands to the right, just as with the UIImage
.
I know to make a custom cell in Interface Builder, but then I do it I don't know how to get the checkmark image, the one that is used when setting the UITableViewCellAccessoryCheckmark
. There is the disclosure available as a button (and several others), but the checkmark does not seems to be available. Is there a way to get the checkmark icon and use it in a custom cell in Interface Builder? I don't want to make my own checkmark.
I have searched the Internet and Stackoverflow, but I cannot find the answer to my question. I guess I am missing a crucial part, but I cannot figure this one out by myself.
Are there any free open source or creative commons replacements?
If I'm understanding everything correctly, it seems like the easiest thing to do would be to not use the built in text and detail text on the cell and customize those labels as well.
Then in your:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
adjust the width/offset of your labels as necessary.
For the checkmark, if you're not adjusting where the disclosure image appears you should just be able to set it with cell.accessoryType = UITableViewCellAccessoryCheckmark