问题标签 [iphone11]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
46 浏览

ios - 从 UIScreen.main.bounds 确定 UIInputViewController 的安全区域

我正在使用 UIInputViewController 制作自定义键盘。

我想在一个矩形内显​​示一个 xib 布局。现在,我确定了 CGRect 的正确大小,我将我的 xib 布局放置在其中,UIScreen.main.bounds从 但是,UIScrren.main.bounds.width当我将 iPhone 11 旋转到横向时,它比安全区域宽度长。结果,我的矩形太宽了,一部分没有显示出来。 iphone11屏幕

如何确定安全界限?我想用类似UIScreen.main.bounds的东西代替,UIScreen.main.safeArea但似乎我必须做一些比这更复杂的事情。

我应该使用UIScreen.main.nativeBounds吗?如果是这样,我不确定如何从像素转换为点。

0 投票
0 回答
17 浏览

flutter - 在 iPhone 11 中打开键盘时图像向下

我已将全屏图像用作背景图像,并TextField在图像顶部放置了一个。因此,当键盘打开时,iPhone11 中的背景图像会稍微下降,而关闭键盘图像时,它会按原样移动。下面的代码在我的 android 设备 [Asus Zenfone Max Pro M1] 和 iPhone 8 Simulator 中正常工作

我的代码片段