1
votes

Let say I have MainView(red) has a subview which is UITextView and UIView(green), I want all subviews width same as superview. I add some constraints add it works EXCEPT the UIView(green). this is how I do it, please see below..

By default MainView has a 320 width.. enter image description here

But when I try to change the width of the MainView to 500, UIView(green) won't follow the constraints, unlike the uitextview. enter image description here

when I click the warning (yellow arrow) this shows the warning constraints of the UIView(subview) only, but how come no warning for UITextView is there any constrains or settings that I missed on that view? enter image description here

Edit: Constrains of UIView (green)

enter image description here

1
Select the green subview in IB. Post a screenshot of the constraint information in its Size Inspector.bilobatum
@bilobatum see the edited. tnxBordz

1 Answers

1
votes

This can happen when frames get out of sync with the constraints. You may be able to remedy this if you select the view and then click on the "Resolve Autolayout Issues" button, enter image description here, and choose "Update All Frames In View" (if you were using storyboard, that option is called "Update All Frames In View Controller). It should update the frames to match the constraints. Then subsequent changes to the red view's width should update the green view, too.