Welcome, Guest
Username Password: Remember me

SCDateCell without Title
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: SCDateCell without Title

SCDateCell without Title 1 year, 9 months ago #1

hi,

is it possible to set the title of a SCDateCell to nil?

i'm using a custom navigation controller background and the title is not part of the design anymore..


cheers,
Martin
  • magegu
  • OFFLINE
  • Junior Boarder
  • Posts: 22
  • Karma: 1

Re: SCDateCell without Title 1 year, 9 months ago #2

Hi Martin:

Since you're using a cell background, you should set the textLabel's background to clearColor:

dateCell.textLabel.text = nil;
dateCell.textLabel.backgroundColor = [UIColor clearColor];

Hope this helps.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: SCDateCell without Title 1 year, 9 months ago #3

hi,

thanks for the answer.

by "title" i did not mean the Textlabel of the cell but the title of the ViewController that is behind the cell with the date picker.

the title of the view controller which equals the label of the cell is used by the navigation controller (that has the background image). this title in the navi Controller should be nil.

dateCell.textLabel.text = nil;
would clear the label AND the title, i just want to have a clean title

hope that made it a bit more clear

thanks !
  • magegu
  • OFFLINE
  • Junior Boarder
  • Posts: 22
  • Karma: 1

Re: SCDateCell without Title 1 year, 9 months ago #4

You can conform to the SCTableViewModelDelegate protocol and implement this method:

 
- (void)tableViewModel:(SCTableViewModel *)tableViewModel detailViewWillAppearForRowAtIndexPath:(NSIndexPath *)indexPath withDetailTableViewModel:(SCTableViewModel *)detailTableViewModel
{
if(indexPath.row == dateCellIndexPath)
detailTableViewModel.viewController.title = nil;
}
 


This should work fine, however, I think we should add a new property called detailViewTitle to SCTableViewCell in our next release.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72
Last Edit: 1 year, 9 months ago by tarekskr.

Re: SCDateCell without Title 1 year, 9 months ago #5

looks good, but is not working for me.

I Implemented the SCTableViewModelDelegate in my Controller, set

	tableViewModel = [[SCTableViewModel alloc] initWithTableView:dateTableView withViewController:self];
tableViewModel.delegate = self;
 


and overwrote the

- (void)tableViewModel:(SCTableViewModel *)tableViewModel detailViewWillAppearForRowAtIndexPath:(NSIndexPath *)indexPath withDetailTableViewModel:(SCTableViewModel *)detailTableViewModel
{
detailTableViewModel.viewController.title = nil;
}


any suggestion?

thx
  • magegu
  • OFFLINE
  • Junior Boarder
  • Posts: 22
  • Karma: 1

Re: SCDateCell without Title 1 year, 9 months ago #6

Have you conformed to the SCTableViewModelDelegate? In the header file, your interface declaration should look something like this:

 
@interface RootViewController : UITableViewController <SCTableViewModelDelegate>
 
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72
  • Page:
  • 1
  • 2
Time to create page: 1.01 seconds