简体   繁体   English

安全区域外的可点击按钮

[英]Clickable buttons outside safe area

Is is possible to have buttons clickable outside safe area (btw how is it called? nonsafe area?)?是否可以在安全区域外单击按钮(顺便说一句,它是如何调用的?非安全区域?)? I have buttons like in screenshot and highlight area where my app doesn't recognize touch (it's screenshot from simulator iPhone XR, there is notch but it's not visible in screenshot):我在屏幕截图和突出显示区域中有按钮,我的应用程序无法识别触摸(它是模拟器 iPhone XR 的屏幕截图,有缺口但在屏幕截图中不可见): iPhone XR 截图

I know that some systems buttons are clickable in that area but I don't know why mine isn't.我知道某些系统按钮在该区域可以点击,但我不知道为什么我的不能。

From my experience, buttons do not respond to touches outside of the safe area.根据我的经验,按钮不会响应安全区域外的触摸。 And this is for a good reason.这是有充分理由的。 Areas outside of the safe area are reserved for iOS system user interface, like displaying the time, battery level, and your cellular signal strength.安全区域之外的区域是为 iOS 系统用户界面保留的,例如显示时间、电池电量和您的蜂窝信号强度。

Apple advises to account for safe area insets when laying out your UI elements. Apple 建议在布局 UI 元素时考虑安全区域插图。

Try running this project on a device like iPhone X or iPhone 11 to test it out: https://github.com/ChopinDavid/safearea尝试在 iPhone X 或 iPhone 11 等设备上运行此项目以进行测试: https : //github.com/ChopinDavid/safearea

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM