segue 缩小视图控制器.如何保持“正常"尺寸 [英] segue shrinks viewcontroller. how to keep "normal" size

查看:29
本文介绍了segue 缩小视图控制器.如何保持“正常"尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 UISegmentedControl 和嵌入式 ViewControllers 设置嵌入式视图控制器选项卡(如本例所示:

拖动Segue,它会变得和原始ViewController (A) 上的视图一样小.(A 嵌入 B,B 转为 Z).笔记:模拟尺寸:固定我可以将 Simulated Size: 更改为 Freeform 并调整高度;但是,不确定它的作用是什么,或者对于各种屏幕尺寸是否不灵活.

解决方案

将模拟大小从固定更改为自由格式,然后将值更改为您想要的任何值.

Setup embedded viewcontroller tabs using UISegmentedControl and embedded ViewControllers (as in this example: https://ahmedabdurrahman.com/2015/08/31/how-to-switch-view-controllers-using-segmented-control-swift/)

Its all good. The tabs work. The UI changes. BUT, when I touch a button in one of the embedded VC's then I want to launch yet another ViewController ("Z". Simple enough? NO! In Interface Builder, when I add the segue to the "Z" controller then IB automatically resizes it in the storyboard. It shrinks to the size of the View associated with the UISegmentedControl.

Is there some setting in IB to tell it to make this "Z" control back to normal size? Its messed up when I run it in the simulator too: stuff gets cut off, unless I put a spring to the bottom of the screen.

And/or is there something I can do on the segue or something so it doesn't shrink the target ViewController when I drag the seque to it?

Original size of "Z" ViewController: Top VC is from the View for the UISegmentedControl. Second VC is the embedded VC. Third is the "Z", the one embedded should launch.

Drag Segue and it becomes as small as the view on the original ViewController (A). (A embeds B, the B segues to Z). Note: Simulated Size: Fixed I can change the Simulated Size: to Freeform and play with the height; but, not sure what that does, or if that's going to be inflexible for various screen sizes.

解决方案

Change the simulated size from fixed to freeform then change the values to whatever you'd like.

这篇关于segue 缩小视图控制器.如何保持“正常"尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆