stanley
stanley

Reputation: 1153

how should i add a textfield/button to a table view controller?

I have a UITableViewController with a nav bar up top from an embedded nav controller. In between the nav bar and the start of the cells I'm trying to add a textfield and button sort of like a search bar layout but for a different purpose.

On my storyboard, I can drag in a button or a label, but it automatically fills the width of the scene. As a result there is only room for one or the other. I tried editing with the size inspector in the right pane but it reverts to the old number everytime.

How would I pull this layout off?

Upvotes: 1

Views: 1785

Answers (1)

souvickcse
souvickcse

Reputation: 7804

Create a view with the label/text field and the button then drag the view to the top of the tableview. It will add the view as a header view.

Upvotes: 2

Related Questions