Welcome, Guest
Username Password: Remember me

SCLabelCell textLabel font change ok, but not detailTextLabel font
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: SCLabelCell textLabel font change ok, but not detailTextLabel font

SCLabelCell textLabel font change ok, but not detailTextLabel font 1 year, 2 months ago #1

Hi,

I've successfully managed to change the font for the textLabel of an SCLabelCell, but I can't seem to do it for the detailTextLabel value.

Is this possible?

In fact, it seems that I can't set any parameters on it that work. I tried setting the textAlignment to left justified and also the numberOfLines property, but it still only shows 1 line and the text is still right justified appearing on the same line as the textLabel.


Thanks!

Brendan
  • tapforms
  • OFFLINE
  • Expert Boarder
  • Posts: 120
  • Karma: 4
Thanks!
Brendan
www.tapforms.com

Re: SCLabelCell textLabel font change ok, but not detailTextLabel font 1 year, 2 months ago #2

Hi Brendan,

The following code is working for me:

 
- (void)tableViewModel:(SCTableViewModel *)tableViewModel
willConfigureCell:(SCTableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if([cell isKindOfClass:[SCLabelCell class]])
cell.detailTextLabel.font = [UIFont systemFontOfSize:20];
}
 


Is this not working for you?
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: SCLabelCell textLabel font change ok, but not detailTextLabel font 1 year, 1 month ago #3

Hi Tarek,

Wow, it's been a long time since you replied and I didn't reply. I got distracted with another project for the last 5 weeks or so and only just back to working on Tap Forms this weekend. No, this is not working for me. In fact, no matter what I do to the detailTextLabel, nothing affects it.

I've tried setting the background (or foreground) colour of the detailTextLabel and it also has no effect:

if ([cell isKindOfClass:[SCLabelCell class]]) {
cell.detailTextLabel.backgroundColor = [UIColor yellowColor];
}


I'm quite puzzled right now. I know this should work.

I'm sure I'm doing something stupid that'll take me hours and hours to figure out and then realize it was something dumb that I could have fixed in 2 minutes.

Thanks,

Brendan
  • tapforms
  • OFFLINE
  • Expert Boarder
  • Posts: 120
  • Karma: 4
Thanks!
Brendan
www.tapforms.com

Re: SCLabelCell textLabel font change ok, but not detailTextLabel font 1 year, 1 month ago #4

Hey Brendan,

Where exactly are you having this code called? STV internally automatically sets the textLabel & detailTextLabel's background colors to the same background color of the cell (to save you some code if you ever change the cell's background color). Because of this, I would advice calling the above code in willDisplayCell. Hope this helps!
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72
  • Page:
  • 1
Time to create page: 1.65 seconds