为什么我在 iPhoneX 模拟器底部看到白色区域?

2023-09-09移动开发问题
12

本文介绍了为什么我在 iPhoneX 模拟器底部看到白色区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我已经在 stackoverflow 中阅读了一些类似的答案

我们可以看到,我的 loginVC 底部有一个白色区域.我希望我的 UIImage(背景图像)覆盖那个白屏区域.

我已将 UIImage 的图像底部约束设置为如下所示的安全区域

我也用过使用安全区域布局指南"

这里出了什么问题?

解决方案

去掉align bottom to Safe Area并添加Bottom Space to super View(将bottom Space附加到superview,类似于您的顶部空间-附有superview)

(另外,为包含文本请联系 IT 支持"的标签设置 align bottom to Safe Area)

更新:

这是一种针对您的问题的补丁解决方案.您实际上应该在安全区域布局之外设置图层(设置图层 1357 相对于超级视图的所有锚点)并添加附加的附加透明视图(UIView)与(所有锚点)安全区域布局,包含所有其他 UIElements,以非常处理它很容易.

I have read some answer in the stackoverflow like this one Seeing black bars at the top and bottom of the iPhone X Simulator , but it seems little bit different since my issue only happens only in the bottom area of my screen

as we can see, there is a white area in the bottom of my loginVC. I want my UIImage (background image) to cover that white screen area.

i have set the image bottom constraint of the UIImage to the safe area like below

I have also used "use safe area layout guides"

what went wrong in here?

解决方案

Remove align bottom to Safe Area and add Bottom Space to super View (attach bottom space to superview, similar to your top space - is attached with superview)

(Also, set align bottom to Safe Area for your label containing text "Please contact IT support")

Update:

This is a kind of patch solution to your problem. You should actually set Layer outside your safe area layout (Set all anchors of Layer 1357 with respect to super view) and add additional transparent view (UIView) attached with (all anchors) Safe Area layout, containing all other UIElements, to handle it very easily.

这篇关于为什么我在 iPhoneX 模拟器底部看到白色区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

硬件音量按钮更改应用程序音量
Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)...
2024-08-12 移动开发问题
10

恢复游戏 cocos2d
Resume game cocos2d(恢复游戏 cocos2d)...
2024-08-12 移动开发问题
6

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

[ios.cocos2d+box2d]如何禁用自动旋转?
[ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)...
2024-08-12 移动开发问题
7

从 Documents 目录存储和读取文件 iOS 5
Storing and reading files from Documents directory iOS 5(从 Documents 目录存储和读取文件 iOS 5)...
2024-08-12 移动开发问题
9

如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?
How can I implement a virtual joystick for a cocos2d game outside the cocos2d environment?(如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?)...
2024-08-12 移动开发问题
13