سؤال

My iOS apps shows a UITableView with a tableHeaderView containing 3 subviews (A,B and C).


| A |

| B |

| C |

| cell1 |

| cell2 |

| cell3 |

| ... |

The problem is that when I remove C using:

[C removeFromSuperview]

I have a white gap left that I would like to remove too in order the tableview to be attached directly to B. I tried resizing the whole tableHeaderView and tweaking the AutoresizingMask,but with no luck.

Any suggestion?

هل كانت مفيدة؟

المحلول

It sounds like you need to tell the table to resize the header view. Just setting the tableHeaderView works for me

tableView.tableHeaderView = tableView.tableHeaderView
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top