UA-17470720-3

Jump to content


Photo
- - - - -

Custom header view


  • Please log in to reply
6 replies to this topic

#1 Jesse Knowles

Jesse Knowles

    Jr. Member

  • STV 2.0
  • PipPip
  • 17 posts
Reputation: 2
Good

Posted 13 December 2010 - 03:29 PM

Hello, I am trying to figure out how to create a custom header view. Here is what I'm dealing with right now. I have a grouped table view and I want to create a header view that has an image and specifically positioned text in it that will display above all the other grouped sections in the list. How would I go about adding this view to the table header?

Thanks a lot.

#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 13 December 2010 - 03:44 PM

Hi Jesse,

If I understand you correctly, all you need to do is create your view and set your table's tableHeaderView property to it:

...
tableModel.modeledTableView.tableHeaderView = myView;
...

Please tell me if you need more help.

#3 Jesse Knowles

Jesse Knowles

    Jr. Member

  • STV 2.0
  • PipPip
  • 17 posts
Reputation: 2
Good

Posted 13 December 2010 - 07:37 PM

Thanks, that has worked except, is I would like to put it in a grouped cell above the cells below it. The way you explained simply allows me to add a view with nothing behind it, but I would like the rounded white cell background to show up behind the header view. Is there a way to do that? Thanks.

#4 Jesse Knowles

Jesse Knowles

    Jr. Member

  • STV 2.0
  • PipPip
  • 17 posts
Reputation: 2
Good

Posted 13 December 2010 - 08:14 PM

OR... something I could do instead is just use the first cell in the table to put a custom view in it. Is that doable? How would I go about it? Thanks.

#5 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 13 December 2010 - 11:37 PM

Do you want this custom header to stay static as the table scrolls, or is it ok for it to scroll?

#6 Jesse Knowles

Jesse Knowles

    Jr. Member

  • STV 2.0
  • PipPip
  • 17 posts
Reputation: 2
Good

Posted 14 December 2010 - 09:01 AM

No I don't want it static. Perhaps I asked the wrong question. I just want the top section of my table to have a custom view in it instead of the pre-set views that SCTableView provides. So I want the clients logo in a particular spot, plus some supporting text below it. That kind of thing. I don't see in the documentation where I can put my own view in a section of a table. Thanks a lot.

#7 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 15 December 2010 - 09:51 AM

I think the best way to achieve what you want is by creating a normal SCTableViewSection and then adding a custom cell to it. Our 2.0 release (still in beta) fully supports creating your cell's controls in Interface Builder. I'll send you a copy of our latest beta version. For more information, please check out: http://www.sensiblec...a-released.html

Please tell me if this works for you, or if you need any further assistance.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users