ios - 嵌入式 UIVIewController 在触摸或滚动时意外水平扩展

标签 ios xamarin

我有一个带有 UIScrollView 的 UIViewController。 ScrollView 通过嵌入 segues 在 UIViews 中嵌入了六个不同的 View Controller 。第六个嵌入式 View Controller 在滚动和触摸时水平扩展...

这不是预期的行为。即使我愿意,我也不确定我会怎么做。罪魁祸首是什么?

enter image description here

主要VC:

enter image description here

主要 VC 结构: enter image description here

最佳答案

由于您给containerViews的静态宽度为320,这就是为什么内容不适合所有设备,因此发生滚动,您需要从containerView到主outerView按住ctrl键拖动并选择EqualWidths

已知的行为是将 contentView 作为 ScrollView 的第一个 subview ,并将其宽度 Hook 到主外部 View ,而不是像这样对 stackView 的所有 subview 执行此操作

> scrollView
 > contentView
   > containerView1
   > containerView2

然后 Hook 前导 && 尾随足以使其填充当前空间加上它的定位

关于ios - 嵌入式 UIVIewController 在触摸或滚动时意外水平扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53991137/

相关文章:

iphone - 在 Xcode 4.2 中使用 GPX 路线或轨道进行测试

ios - Swift3 麦克风音频输入 - 无录音播放

c# - Android 不支持全局 PushAsync,请使用 NavigationPage

Xamarin Android 从自定义渲染器通过社交媒体分享链接/文本

c# - 如何对 Controller 中的 View 进行编程更改出现在 Storyboard 中

objective-c - 将所有 UILabel 设置为隐藏

ios - 如何清除 UIImagePickerController 的背景?

ios - SPTAudioStreamingController 停止 playURIs 短缓冲区

.net - Realm for Xamarin 中的简单迁移

ios - 如何在我的应用程序中找到私有(private) iOS API 使用情况?