ios - 是否可以将 UIView 移出 Controller 而不被剪切?

标签 ios objective-c swift uiview

我有 2 个 UIViewController。一个是内容,另一个是幻灯片菜单。

enter image description here

我想像这样将 Controller 2 的按钮移到它的 super View 之外

enter image description here

这可能吗?因为我试图为 super View 设置 clipToBounds = NO。我得到的唯一结果是:

enter image description here

有什么建议吗?

最佳答案

这里有几个选项。最明显的是 Controller 2 的 View 上的 clipToBounds = NO,以及包含该按钮的任何其他 subview 。

如果您不想将其设置为NO,则该 View 不能成为裁剪 View 层次结构的一部分。然后,您必须将它移动到共享的父 View ,例如容器 Controller 的 View 、窗口等。

关于ios - 是否可以将 UIView 移出 Controller 而不被剪切?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32209491/

相关文章:

swift - 从 PFGeoPoint 中获取纬度/经度

swift - 我可以在 Swift Playgrounds 中添加章节动画吗?

ios - 在 UITableView 中加载数据时,cell.contentView.viewWithTag 给出 nil 值

ios - 如何在 NSTextAttachment 中设置模板图像的颜色

ios - swift 表格 View 中的字母部分

ios - 如何解析响应 xml 字符串?

ios - 关于 UIButton 的 titleLabel 和 imageView 属性的困惑

ios - 在 v5 中将预取图像复制到内存中 (SDWebImageCacheMemoryOnly)

ios - 正确地将十六进制转换为 base64

ios - 如何在 View 可见时添加动画?