简体   繁体   English

在Xcode中使用自由格式的模拟尺寸时,如何使屏幕适应?

[英]How to make the screen adapt when you use a freeform simulated size in Xcode?

I am making an app and I have a UIScroll view in my viewController. 我正在制作一个应用程序,并且在viewController中有一个UIScroll视图。 I have set the simulated size to freeform and the height to 2000 and width to 375. When I run my app on the Iphone 7 There are no problems. 我已将模拟大小设置为自由格式,将高度设置为2000,将宽度设置为375。在Iphone 7上运行我的应用程序时,没有问题。 But when I try to run the app on the iphone 7plus the screen does not adapt and i get these white bars on the right side because my contents width is only 375 pixels. 但是,当我尝试在iphone 7plus上运行该应用程序时,屏幕无法适应,并且由于我的内容宽度仅为375像素,所以在右侧显示了这些白色条。 So how can I make my screen to automatically go bigger when I use a bigger device? 那么,当我使用更大的设备时,如何使屏幕自动变大?

如果尚未完成,则应在UIScrollView添加约束(后缀,前导,顶部空间,底部空间),以将其固定到超级视图范围。

暂无
暂无

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

相关问题 如何使用Freeform Simulated Size更改scrollView的高度但不更改width - How to use Freeform Simulated Size to change height of scrollView but not width 在 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 Size模拟指标在Xcode 4.2之前不可用”警告? - How can I fix “Freeform Size simulated metrics are not available prior to Xcode 4.2” warnings? Xcode模拟大小度量 - Freeform和None设置之间的差异 - Xcode simulated size metric - difference between Freeform and None setting 构建和模拟应用程序时,Xcode 7白屏 - Xcode 7 white screen when app is built and simulated 无法在XCODE故事板上使用FREEFORM - Unable to use FREEFORM in XCODE STORYBOARD Xcode SpriteKit 如何在不同屏幕尺寸的 GameScene 中适配 label? - Xcode SpriteKit how to adapt label in GameScene with different screen sizes? 如何将“自由形式”UIViewController适应多种屏幕尺寸? - How to fit a “freeform” UIViewController to multiple screen sizes? 当应用程序在其他设备上运行时,如何使对象适应其他大小。 (迅速) - How to make an object adapt to another size when the app runs in another device. (swift) 当用户在 swift 中将屏幕从纵向更改为横向时,如何使滚动视图内的 UIView 适应屏幕方向 - How to make UIView which is inside scrollview adapt to screen orientation when user changes screen from portrait to landscape in swift
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM