我试图获取 UITable View 的节标题中的文本进行换行和/或滚动。
我已经尝试过这个:
// support line break mode for multiline
headerLabel.lineBreakMode = UILineBreakModeWordWrap;
// 0 means any number of lines - necessary for multiline
headerLabel.numberOfLines = 0;
// fit the text
[headerLabel sizeToFit];
但没有运气。
建议?
最佳答案
确保使用
设置标题的高度-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
关于objective-c - 如何在 UITableView 部分标题中进行文本换行或滚动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7781911/