UA-17470720-3

Jump to content


Photo
- - - - -

Making a custom Header cell

sections cells

  • Please log in to reply
4 replies to this topic

#1 David DelMonte

David DelMonte

    Forum Master

  • STV 4.0 Pro
  • PipPipPipPipPipPipPip
  • 527 posts
Reputation: 41
Excellent

Posted 01 January 2015 - 10:01 AM

Hi and Happy New Year to all.

 

I have some sections that are shown in the image below.

 

I have a few things I'd like to change, but I don't know how.

 

1. I want to move the age stuff from each cell to the header cell.

 

2. How can I reduce the space between the sections.

 

3. Where is a better place to move that cog (just need opinions please)

 

4. How can I color the SCExpandCollapse sections permanently? Right now, they turn red only after the cell is opened and closed.

 

 

I know I'm asking a lot of things here. I really appreciate the help, and maybe my questions give Tarek and co. some ideas for STV enhancement :) Well, I can wish..

 

Attached File  Screen Shot 2015-01-01 at 12.56.47 PM.png   19.7K   11 downloads


Edited by David DelMonte, 01 January 2015 - 10:02 AM.


#2 ozie

ozie

    ¯\_(ツ)_/¯

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 526 posts
  • LocationAustralia
Reputation: 169
Popular

Posted 01 January 2015 - 05:04 PM

1. i remember Tarek gave you some code on how to add the (1) to the header.. so i would do this, that way :)

 

2. change the table style from grouped to plain.. or set the footer height to 0.1 or something

 

3. to a toolbar at the bottom like the uinavigationbar.toolbar or to the top navber??

 

4. how are you colouring it now for when its open??? are you using a theme file?? for the cell in code the willConfigure action to color it


  • David DelMonte likes this

P.S. I hate Swift.. don't talk Swift.. Too old school to learn yet another programming language.


#3 David DelMonte

David DelMonte

    Forum Master

  • STV 4.0 Pro
  • PipPipPipPipPipPipPip
  • 527 posts
Reputation: 41
Excellent

Posted 01 January 2015 - 05:42 PM

Thanks Ozie. Tarek's code is great, and I use it to create a compound label that I'm using in a standard header view . But I'm taking it a step further, so that I use a custom header cell. I'm trying to work with this answer

 

So my q1 is: In STV4, how would I incorporate a custom header?

 

Q2. Plain style doesn't work with custom headers, but change footer size did. so thanks..

 

Q3. I cannot get a Toolbar to work. I think it's conflicting with the SplitView. I'll look around some more.

 

Q4. Section coloring is only done in the following:

 

 

model.modelActions.didAddSection = ^(SCTableViewModel *tableModel, SCTableViewSection *section, NSUInteger sectionIndex)
{
section.expandCollapseCell = [SCExpandCollapseCell cellWithExpandText:section.headerTitle collapseText:section.headerTitle ownerSectionExpanded:TRUE];
section.headerView.backgroundColor = [UIColor redColor];

counter = section.cellCount;
};
 


#4 ozie

ozie

    ¯\_(ツ)_/¯

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 526 posts
  • LocationAustralia
Reputation: 169
Popular

Posted 01 January 2015 - 06:02 PM

i am thinking that the expand collapse cell is the header view??.. with Q2 it should work with custom headers

3. should be something like self.navigationController.toolbar

 

4. customise the cell which comes the header view?? or is there still a header space above the cell as the header??

    self.tableViewModel.modelActions.didAddSection = ^(SCTableViewModel *tableModel, SCTableViewSection *section, NSUInteger sectionIndex)
    {
        SCExpandCollapseCell *cell = [SCExpandCollapseCell cellWithExpandText:section.headerTitle collapseText:section.headerTitle ownerSectionExpanded:TRUE];
        cell.backgroundColor = [UIColor redColor];
        
        section.expandCollapseCell = cell;
        
        counter = section.cellCount;
    };

  • David DelMonte likes this

P.S. I hate Swift.. don't talk Swift.. Too old school to learn yet another programming language.


#5 David DelMonte

David DelMonte

    Forum Master

  • STV 4.0 Pro
  • PipPipPipPipPipPipPip
  • 527 posts
Reputation: 41
Excellent

Posted 01 January 2015 - 07:45 PM

Thanks Ozie, I have the header working now :) I appreciate your help and clarity.. I will focus on the toolbar next..







Also tagged with one or more of these keywords: sections, cells

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users