1

I made a breadcrumb navigation and placed some items in it to show where the user is at the moment. In my ProjectsOverViewController class is a IBOutlet with a stackView with some buttons. Outlet for my stack view is in another class and I can´t access it from my BreadCrumbNavigation.


In my BreadCrumbNavigation is a container with some labels and controls. The container is placed randomly in my view. But I want it right under my stackView. enter image description here

let container = UIView(frame: CGRect(x: 0, y: UIApplication.shared.statusBarFrame.height + self.navigationBar.frame.height, width: self.view.bounds.width, height: self.config.height))

Is there a way to grab the stackView outlet and place my container right under it?

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140

1 Answers1

1

use constraints, try to get the bottom anchor for the stackView and alight your container's topAnchor to the stackView's bottomAnchor,

heres an example similar to your need, hope it helps
Align view to bottom in UIStackView

Sanad Barjawi
  • 539
  • 4
  • 15