Try running stackview.layoutIfNeeded()
on each cell's stack view in your cellForRowAt
method. Also are you adding any constraints to the views you are adding to the stack view? if you are doing it via code you could say newView.widthAnchor.constraint(equalToConstant: (UIScreen.main.bounds.width / 3)).isActive = true
to ensure that its the right size (assuming you didn't want any space between them).
your issue is clearly not in uistackview constraints, it's in the table it self.
please add a leading and trailing constraints for the table view and it will work fine.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.