Home > Mobile >  How to hide a certain Section in the UITableView
How to hide a certain Section in the UITableView

Time:09-29

My UITableView there are five sections, including a query returns after the data is still left a Header there, how to hide out in this section, I tried for half a day for a certain section is less than, no similar section [0] method, thank you!!!!!!

CodePudding user response:

It is as you say, each the head of the section? If be inside this table has a proxy method can set the headerview in this section

CodePudding user response:

Section setting specifies a section height is 0.1 as in proxy method setting height don
HeaderView proxy method

CodePudding user response:

The
reference 1/f, So 灬 low-key response:
it is as you say, each the head of the section? If be inside this table a proxy method can set up this section headerview

Not each one, there is no data of the Section hidden, can also display other data

CodePudding user response:

The data source is changed, become n - 1 section

CodePudding user response:

The need to hide, you will make a variable data sources, and then reload tableview
This time everyone's data is different, what was the source of your data? Your data array arr how corresponding section, such as the data is when arr wrapped inside the arr or take data is segmented
To write a little flexible

CodePudding user response:

Is there any way to get a certain sections, such as section [0] this way??

CodePudding user response:

You want to hide away without data Section, you can to get the corresponding Section of the data, the protocol tableView method is a can return every Section height of a method, then we can judge here, if the corresponding data Section is empty, so the height of return 0 (don't know can directly use 0 here, if you use 0 no effect can use 0.001 level), some to return to the normal height, the method is simple and crude

CodePudding user response:

When there is no data in returning to the height of the header 0 to set it up

CodePudding user response:

The height of the data set as a variable or a section to 0

CodePudding user response:

Is the simplest way of hiding, in heightForSection method, judge you to hide section, return the height of 0
  •  Tags:  
  • iOS
  • Related