简体   繁体   中英

How to resize subview in UIView that loaded with nib file

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: 在此输入图像描述

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".

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM