UITableViewSection header

Discussion in 'iOS Programming' started by erdinc27, May 22, 2016.

  1. erdinc27 macrumors regular

    Joined:
    Jul 20, 2011
    #1
    I want to insert a view in tableview's section header even if the section is empty. Can it be done ? I mean if the section is empty there will be only the section header.
     
  2. iphonedude2008 macrumors 65816

    iphonedude2008

    Joined:
    Nov 7, 2009
    Location:
    Irvine, CA
    #2
    You're gonna have to do a workaround for that I'm pretty sure. Someone correct me if I'm wrong, but normally, the table view will not show a section header for an empty section. What I would do is just return 1 for the number of table view cells in that section, and then in your cellforrowatindexpath method, make a custom cell with a height of 0. Crappy workaround I know.
     

Share This Page