UITableView ambiguous height

user3629571

I have UITableView in UIViewController built in a Storyboard. So far so good everything is well until the moment I am taking the viewController's view and set it as a subview for another viewController's view.
Here is a little more code how I do it:

let notificationsSB = UIStoryboard(name: "NotificationsScene", bundle: nil)
let vc = notificationsSB.instantiateViewController(withIdentifier: "NotificationsNavigationController")
vc.view.frame = containerView.bounds
containerView.addSubview(vc.view)

So I use this ViewController on another place and everything visualizes correctly but when I change its frame and add it to another VC's view hierarchy the UITableView's height gets messed up.
When I open the view debugger I can see that it gives me a warning about the table view height.

Here is what the whole thing look like:
[here is what the whole thing look like


A little from the storyboard:
enter image description here

Any suggestions would be appreciated. I tried to make everything from the beginning creating a new UIViewController in the same storyboard and so on but nothing gave me results. Thank you

DonMag

It kinda looks like you are constraining the UITableView to its superview's Layout Guide... but when you load everything into another container, you lose the Layout Guide.

Try changing the Bottom Space constraint to be relative to the superview, not to the Layout Guide.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

UIViews with ambiguous height

From Dev

Ambiguous Layout - "Height is ambiguous for 'Image View'"

From Dev

Ambiguous Layout - "Height is ambiguous for 'Image View'"

From Dev

UITableView height equal to contentSize height

From Dev

Get UITableView cell height

From Dev

Auto Fit Height of UITableView

From Dev

Uitableview cell dynamic height

From Dev

Dynamic UITableView height

From Dev

Dynamic height of UITableview Issue

From Dev

Adjusting uitableview height

From Dev

Resizing UITableview height programmatically

From Dev

UITextview height in UITableview swift

From Dev

Auto Fit Height of UITableView

From Dev

Swift UITableView auto height

From Dev

ScrollView has ambiguous scrollable content height

From Dev

iOS - dynamically change height of uitableview

From Dev

UITableView header height will not change in storyboard

From Dev

Custom UITableView Section not increasing height

From Dev

UITableView default row height Xcode

From Dev

Change the UITableView's height for HeaderInSection?

From Dev

Change UIView height with respect to UITableview

From Dev

UITableView inside UIScrollView height error

From Dev

How to dynamically set the height of a UITableView?

From Dev

Custom UITableView Section not increasing height

From Dev

iOS - dynamically change height of uitableview

From Dev

Displaying an UIWebView and UITableView with different height

From Dev

UITableView inside UIScrollView height error

From Dev

How to set height of UITableView programatically

From Dev

ios UITableView after CGAffineTransformMakeScale, how to reset UITableView's height