[英]Swift Change UIContainerView height and width
I have two ContainerView which are placed above each other,for example ContainerA is front of ContainerB. 我有两个彼此叠置的ContainerView,例如ContainerA在ContainerB的前面。
When a Button tapped ContainerA width and height should change to a smaller size, then ContainerB will be shown. 当点击按钮时,ContainerA的宽度和高度应更改为较小的尺寸,然后将显示ContainerB。
How can I change height and width of a container view using swift instead of story board? 如何使用swift而不是故事板来更改容器视图的高度和宽度? does it have something like transform?
它是否具有类似transform的功能?
change its frame: 更改其框架:
let currentContainerViewFrame = containerView?.frame
currentContainerViewFrame?.width -= 200
currentContainerViewFrame?.height -= 200
containerView?.frame = currentContainerViewFrame
or work with its transform property: 或使用其transform属性:
containerView?.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.7, 0.7)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.