4

I've tried to create custom UIView, which contains another UIView as subview. But when I loaded it with "loadNibNamed", I cannot change the frame size of subview inside the custom view.

Pictures below is how I added the view to the viewcontroller. I still can change some property of subview, but not for the "frame". How can I change the frame size in my custom view ?

Snapshot: enter image description here

David
  • 15,894
  • 22
  • 55
  • 66

1 Answers1

5

Disable autolayout in MyView.xib. Constraints from XIB file resize redView back.

Go to the File inspector in interface builder, and untick "Use Auto Layout".

LorikMalorik
  • 2,001
  • 1
  • 14
  • 14