Currently, I have a Vertical StackView. Inside that StackView, there are three Horizontal StackViews. In each one of those, there are two UIView's which are loading a XIB Storyboard View that I have created. It looks like this:
In each of those XIB UIViews there is a ImageView and a Label. Currently I am having an issue where the first ImageView in the first UIView is the correct size, but all the other ImageViews following it have been shrunk for some reason. This is what I mean:
What I've found, is that if I uncomment the line of code that sets the image for the "FIRST ITEM"'s ImageView, the "SECOND ITEM" will now be the correct size, and everything after that will be shrunk as seen here:
For some reason, only the ImageView that's been set first will be the correct size and everything after that will be shrunk.
The constraints on the XIB file is as follows:
The Content Mode on the ImageView is "Aspect Fit".
Both the overarching Vertical StackView and each Horizontal StackView has "Distribution" set to "Fill Equally".
I set all the UIView information in the viewDidLoad function like this:
calendarMenuItem.setBackgroundColour(colour: Environment.Colours.navyGreen)
calendarMenuItem.iconImageView.image = UIImage(systemName: "calendar.circle.fill")
calendarMenuItem.headingLabel.text = "FIRST ITEM"
Does anyone know how I can fix it? I'm sorry if I haven't provided enough information because I'm not sure what else to provide. If you need to see more I can update the question.
Thank you.