mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 23:18:27 +02:00
Room details: BugFix compute the actual height of table cell
This commit is contained in:
@@ -292,12 +292,11 @@
|
|||||||
MXEvent *mxEvent = [messages objectAtIndex:indexPath.row];
|
MXEvent *mxEvent = [messages objectAtIndex:indexPath.row];
|
||||||
|
|
||||||
// Use a TextView template to compute cell height
|
// Use a TextView template to compute cell height
|
||||||
UITextView *textViewTemplate = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 200, 40)];
|
UITextView *dummyTextView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 200, MAXFLOAT)];
|
||||||
textViewTemplate.scrollEnabled = NO;
|
dummyTextView.font = [UIFont systemFontOfSize:14];
|
||||||
textViewTemplate.autoresizingMask = UIViewAutoresizingFlexibleHeight;
|
dummyTextView.text = [mxHandler displayTextFor:mxEvent inDetailMode:NO];
|
||||||
textViewTemplate.text = [mxHandler displayTextFor:mxEvent inDetailMode:NO];
|
CGSize contentSize = [dummyTextView sizeThatFits:dummyTextView.frame.size];
|
||||||
[textViewTemplate sizeToFit];
|
rowHeight = contentSize.height + (TEXT_VIEW_VERTICAL_MARGIN * 2);
|
||||||
rowHeight = textViewTemplate.frame.size.height + (TEXT_VIEW_VERTICAL_MARGIN * 2);
|
|
||||||
|
|
||||||
// Force minimum height: 50
|
// Force minimum height: 50
|
||||||
if (rowHeight < 50) {
|
if (rowHeight < 50) {
|
||||||
|
|||||||
Reference in New Issue
Block a user