1

I have a stackView that I fill as such:

override func awakeFromNib() {
    super.awakeFromNib()
    for _ in 0 ..< 31 {
        let tick = UIView()
        self.dayTicks?.addArrangedSubview(tick)
        let arrowImage = UIImage(named: "Up Arrow")
        let arrowImageView = UIImageView(image: arrowImage)
        arrowImageView.clipsToBounds = false
        self.arrowTicks.addArrangedSubview(arrowImageView)
    }
}

basically I am adding a normal view as well as an arrowImageView from a UIImage. I am doing addArrangedSubview in both cases. With the normal View, they all show up as rectangles (the default I suppose) which works fine. The arrow ticks stackView currently looks like:

enter image description here

As you can see the views are narrowing themselves as not to overlap. I want them to just overlap. How can I do this? ClipsToBounds does not seem to help in this case.

BigBoy1337
  • 4,735
  • 16
  • 70
  • 138
  • I can't picture much your case, but the idea in "overlapping" is that you can just add your view that you need to overlap something to the superview of that something. – Glenn Posadas Jul 03 '18 at 02:57

1 Answers1

0

Well, the main idea of the stack view is that it handles subviews arrangement by itself so you don't have to deal with it by yourself. If you want your subviews to be overlapped why not just add them to a regular view?

ahagbani
  • 122
  • 1
  • 8