I am using the Sensible TableView an would like to create a cell that list business hours. For example:
Monday to Friday: 9AM to 9PM
Saturday: 10AM to 5PM
Every Day: 9AM to 5PM
For some reason, I cannot get the SCTextViewCell, SCTableViewCell or SCLabelCell to resize automatically (from 1 line to multiple lines).
Here is the code that I used to test the SCTextViewCell:
SCTextViewCell *businessHoursCell = [SCTextViewCell cellWithText:NSLocalizedString(@"Business Hours", nil)]; //NSString *str = @"Just one line"; NSString *str = @"Monday - Friday: 7AM to 9PM nSaturday: 9AM to 5PM nSunday: Closed nChristmas, Easter: ClosednMy Wife's birthday: 9AM to 1PM"; //NSString *str = _currentLocation.hoursOfOperation; businessHoursCell.detailTextLabel.text = str; businessHoursCell.autoResize = YES; businessHoursCell.detailTextLabel.numberOfLines = 0; businessHoursCell.editable = NO; businessHoursCell.userInteractionEnabled = NO; [detailSection addCell:businessHoursCell];
I did the same for the SCLabelView, but in that case also set the lineBreakMode to WordWrap.
I have attached what the output currently looks like.
Note: I am using version 2.2.0