Welcome, Guest
Username Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Custom header view

Custom header view 1 year, 5 months ago #1

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.
  • Kinoli
  • OFFLINE
  • Fresh Boarder
  • Posts: 17
  • Karma: 0

Re: Custom header view 1 year, 5 months ago #2

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.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: Custom header view 1 year, 5 months ago #3

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.
  • Kinoli
  • OFFLINE
  • Fresh Boarder
  • Posts: 17
  • Karma: 0

Re: Custom header view 1 year, 5 months ago #4

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.
  • Kinoli
  • OFFLINE
  • Fresh Boarder
  • Posts: 17
  • Karma: 0

Re: Custom header view 1 year, 5 months ago #5

Do you want this custom header to stay static as the table scrolls, or is it ok for it to scroll?
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: Custom header view 1 year, 5 months ago #6

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.
  • Kinoli
  • OFFLINE
  • Fresh Boarder
  • Posts: 17
  • Karma: 0
  • Page:
  • 1
  • 2
Time to create page: 0.92 seconds