UA-17470720-3

Jump to content


Photo
- - - - -

Can No Longer Center Text on an SCTableViewCell


  • Please log in to reply
3 replies to this topic

#1 Bruce Vander Werf

Bruce Vander Werf

    Sr. Member

  • STV 5.0 Pro
  • PipPipPip
  • 30 posts
Reputation: 7
Good

Posted 10 August 2015 - 07:14 AM

Using STV 5...

 

I have this pattern all over my project:

 

SCTableViewCell* tableViewCell = [SCTableViewCell cellWithText:@"Foo"];
tableViewCell.textLabel.textAlignment = NSTextAlignmentCenter;

 

Also tried:

 

SCTableViewCell* tableViewCell = [SCTableViewCell cellWithText:@"Foo" textAlignment:NSTextAlignmentCenter];

 

Either way, text is always left-aligned.

 

Bruce

 



#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 10 August 2015 - 07:32 AM

Hi Bruce,

 

I just tested your exact code and it seems to be working fine (please see attached image). I am using STV 5.0.0 on Xcode 7 beta 5.

 

Are you able to attach any basic sample that demonstrates this?

 

Thanks!

 

Attached File  CenterTest.png   15.59K   10 downloads



#3 Bruce Vander Werf

Bruce Vander Werf

    Sr. Member

  • STV 5.0 Pro
  • PipPipPip
  • 30 posts
Reputation: 7
Good

Posted 23 September 2015 - 08:01 AM

Tarek,

 

Sorry to not follow up on this sooner. I don't think the issue was STV.

 

As it turns out, changing the font on the detailTextLabel in onConfigure resets the alignment on the textLabel.


  • Tarek likes this

#4 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 23 September 2015 - 12:54 PM

Thanks a lot Bruce for the update.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users