Newbie
Newbie

Reputation: 2825

why header of a section of a uitableview is abnormally tall when the uitableview is embedded to a uiviewcontroller?

I would like to make a page like this (i.e. a fix segmented controller on the top, with a uitableview appending beneath it):

enter image description here

So, this is the way I did it: I have added a segmented controller in a uiviewcontroller, then I append a uitableview under it. Here is the diagram in the storyboard:

enter image description here enter image description here

However, when it runs in the simulator, the header of the uitableview is abnormally tall.

I have no idea why it is like this. Am I going to a wrong direction? Thanks for any helps.

UPDATE: This is the default setting of the uitableview. I didn't change any thing.

enter image description here

Upvotes: 0

Views: 116

Answers (2)

bilobatum
bilobatum

Reputation: 8918

Select your view controller in storyboard. In the Attributes inspector, uncheck "Adjust Scroll View Insets" and uncheck "Under Top Bars".

Upvotes: 1

Mani
Mani

Reputation: 17595

You have placed Segment control in Tableview's header. But you had set some height to tableview section header via either xib or programmatically. That's why it leads to show this space.

Upvotes: 0

Related Questions