简体   繁体   English

[iOS]我可以在代码上更改自由格式UIViewController的大小吗?

[英][iOS]Can I change the size of a freeform UIViewController on code?

I want to change the size of UIViewController whose size has already set in storyboard as freeform . 我想更改UIViewController的大小,该大小已在storyboard freeform设置为freeform I need to remove some subview s after I get a certain result from a server. 从服务器获得一定结果后,我需要删除一些subview Originally the size is 320x750 but it sometimes will be reduced to 320x500. 最初的尺寸为320x750,但有时会缩小为320x500。

I use autolayout. 我使用自动版式。

Any suggestions? 有什么建议么?

I would remove autolayout and then use 我会删除自动版式,然后使用

   setPreferredContentSize:(CGSize)

If you want to keep autolayout, you'll have to programatically add constraints. 如果要保留自动版式,则必须以编程方式添加约束。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何修复“Freeform Size模拟指标在Xcode 4.2之前不可用”警告? - How can I fix “Freeform Size simulated metrics are not available prior to Xcode 4.2” warnings? 在 XCode 11 中使用 FreeForm 作为模拟尺寸时,无法将 UIView 安装到 UIViewController 的全尺寸 - Not able to fit UIView to the full size of UIViewController when using FreeForm as Simulated Size in XCode 11 如何使用Freeform Simulated Size更改scrollView的高度但不更改width - How to use Freeform Simulated Size to change height of scrollView but not width iOS更改UIViewController - iOS change UIViewController IB 中的“自由格式”大小 - 故事板 - "Freeform" size in IB - Storyboard FreeForm ViewController-iOS - FreeForm ViewController - iOS 如何在iOS 8的UINavigationViewController中更改UINavigationBar的大小? - How can I change size of UINavigationBar in UINavigationViewController in iOS 8? 为什么要编译这样的代码? 在iOS UIViewController中调用popToRootViewControllerAnimated吗? - Why can such code be compiled? Call popToRootViewControllerAnimated in iOS UIViewController? 如何在iOS中一键更改UIViewController? - How do I change a UIViewController with one tap in iOS? 如何将“自由形式”UIViewController适应多种屏幕尺寸? - How to fit a “freeform” UIViewController to multiple screen sizes?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM