Adding multiple lines of text to detailTextLabel without creating a custom cell

Is it possible to add multiple lines of text as detailTextLabel without creating a custom cell in my application? If this can someone show me the correct way to implement this?

+3
source share
2 answers

The line of code cell.detailTextLabel.numberOfLines = x; will be set to the number of lines that your cell will display (x is the number of lines to be displayed). Set to 0 if you want to remove the maximum limit and display as many lines as necessary.

+9
source

Change the style of your cell using the cellForRowAtIndexPath function.

cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
+1
source

Source: https://habr.com/ru/post/1774985/


All Articles