-1

I have custom tableview (xib) in freeform size with height 350pts. I want to present that tableview partially as shown in the picture, but when I try to presentViewController with that 350 height still, it appears to present in the whole screen not as I desired.

****IMAGE*****

https://drive.google.com/file/d/0B3Q2nuVLZgySY2laVWtKRDQtdVU/view?usp=sharing

3 Answers3

1

You should check UIPresentationController, this is exactly what you want.

It's very complicated because you have to implement a lot of things, but you will be able to constraint in code the viewport of your view controller, make animations alongside the system ones and update layout for any sizeclass.


Or, you can make your child view controller with a transparent top margin background.

Crazyrems
  • 2,551
  • 22
  • 40
0

In apple documentation.

The size and position of the root view is determined by the object that owns it, which is either a parent view controller or the app’s window. The view controller that is owned by the window is the app’s root view controller and its view is sized to fill the window.

0

Try to set the y coordinate of your table view and set its height to the height of your super view minus y.
For ex:-tableView.frame=CGRectMake(x,100,self.view.frame.size.width,self.view.frame.size.height-100);
Hope this work.

Akshay Agrawal
  • 217
  • 3
  • 12