SlackTextViewController icon indicating copy to clipboard operation
SlackTextViewController copied to clipboard

Resizing tableview inside of view controller

Open thomashocking opened this issue 9 years ago • 3 comments

Hi, I'm sorry if this is not the correct place to ask for specific help.

I was wondering if there is a way to add a view above the tableview and have the tableview resize to under the added view.

I attached a screen shot of what I'm trying to do. The scroll bar and content are still under the blue view so if I scroll up, the view hides the content. I was thinking I could just add a constraint from the top of the tableview and the bottom of the blue view. But I'm not sure if that'll break anything else.

Thanks

screen shot 2016-05-15 at 3 13 04 pm

thomashocking avatar May 15 '16 20:05 thomashocking

Not sure if this fixes your problem, but for readability and real estate maximisation, I'd recommend that you use a tableHeaderView, or tableFooterView, instead of using a fixed view.

Otherwise, if you still need to have a fixed view, the best way is to add it to the table view, and scroll it in the opposite direction of the tableview scroll.

Mamonaku avatar May 18 '16 12:05 Mamonaku

One even easier way is to change the tableView's contentInset, and give to top the height value of your custom vien. If that isn't enough and you really need a static container at the top, I would suggest to fork the project and add it to you SLKTextViewController super class directly and modify the internal view constraints.

dzenbot avatar May 18 '16 16:05 dzenbot

Great thanks a lot for the tips!

thomashocking avatar May 28 '16 20:05 thomashocking