开发者

Can I stop my detailLabel from resizing when I set UITableviewCellAccessoryCheck?

I have several UITableViewCells which are used to choose a setting. Touching one checks it and un-checks the previously checked cell (if any). I am using the UITableViewCellStyleSubtitle cell style and have about a paragraph of text in each detailLabel. When I set the accessory to UITableviewCellAccessoryCheck my detailLabel resizes, moving the text in a visually unappealing way. I want the detailLabel text to retain its position regardless of whether it is checked or not.

I thought I might be able to get the width of the checked accessory view and pre-emptively shrink the detailLabel width. Is this the correct way to do it?

Must I wait until the cells are about to appear or can I do i开发者_StackOverflowt as they are created in tableView:cellForRowAtIndexPath:indexPath?

Do I have to set the detailLabel's resize mask differently?


set the detailTextLabel's adjustsFontSizeToFitWidth property to NO.

cell.detailTextLabel.adjustsFontSizeToFitWidth = NO;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜