问题标签 [iphone-x]

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 投票
2 回答
3656 浏览

ios - iPhone X 上的 UITabBar 大小增加

我面临的问题是我的标签栏在新 iPhone X 上被拉伸了。我正在使用常规的 UITabBarController 没有进一步的高度样式等。我希望它像 iPhone 8 图片一样放置在视图的底部而不是像此刻一样被拉长。

这容易吗?

iPhone X

UITabBarController iPhone X

iPhone 8

UITabBarController iPhone 8

0 投票
1 回答
4027 浏览

ios - 适用于 iPhone X 的原始深度图 SDK

我进行了一些搜索,发现了各种示例、有关 iPhone X Face ID 的文档以及它如何用于身份验证、动画表情符号等各种内容。

想检查是否有 API/SDK 可以将原始深度图从 iPhone X 传感器获取到应用程序?

据我了解,深度计算是根据投影模式完成的。这可用于获取传感器前方任何物体的深度剖面。(可能取决于对象的纹理。)

0 投票
1 回答
323 浏览

swift - 游戏崩溃仅在 iPhone X 和 iPhone 8 Plus 上

我正在开发游戏,该游戏在所有 iPhone 和 iPad 上都能完美运行,除了 iPhone X 和 iPhone 8 Plus

当我将精灵添加到场景中时游戏崩溃(仅在 iPhone X 和 iPhone 8 Plus 上)因为精灵已经添加到场景中,在其他 iPhone 上应用程序没有崩溃,我认为错误在我的计时器中,也许是错误iPhone模拟器?你怎么看?

代码:

0 投票
3 回答
4078 浏览

ios - Iphone X中Tabbar下方部分的高度

希望有人可以帮助我解决 Iphone X 中标签栏下方的高度。我需要在我的 iPhone X 框架尺寸之一中删除此高度。新的状态栏具有不同的高度,我可以参考该高度:

有谁知道我如何参考 Iphone X 中 Tabbar 下方的高度?:

在此处输入图像描述

0 投票
3 回答
2190 浏览

ios - iPhone X - 我们应该如何处理表格部分标题上方的空间?它通过内容显示

我有一个表格视图,其中包含多个部分和每个部分的部分标题。如您所知,节标题随表格视图移动。因此,如果有多个部分,则当前部分的标题会粘在 tableview 的顶部,而该部分的内容会在标题下滚动。

我试图弄清楚它应该如何适应 iPhone X,因为标题上方的空间通过内容显示,正如您在此屏幕截图中注意到的那样。我查看了 Apple 关于如何适应 iPhone X 缺口的观点,但他们所有的示例顶部都有一个搜索栏视图,因此他们从未真正遇到过这个问题。

在此处输入图像描述

0 投票
6 回答
17245 浏览

ios - iPhoneX and iPhone 8 keyboard height are different

I use below code to get keyboard height. Then use this height to calculate the frame of an UIView to make sure this UIView just on the top of the keyboard.

But in iPhoneX simulator the output is 333 and the iPhone 8 simulator is 258.

ISSUE: If use rect.height as the keyboard height for iPhone 8 simulator then the layout is correct. For iPhone X there's a gap between the UIView and keyboard. Which means 333 is higher than the real keyboard height in iPhone X.

What's the reason of the height are different? And how to get the correct keyboard height?

Like this image, the green border should be the extra part. Actually, I need the red part just on the top of keyboard without the green rect gap. enter image description here

EDIT

OK, with @Craig's help I found this method only called by iPhone X. So I update frame here. Just paste the code here.

The safe area bottom height is 22.0 seems not correct.

EDIT2 Normally view.safeAreaInsets.bottom should be 34.0, but if you are using container view this value can be different like mine is 22.0.

0 投票
1 回答
868 浏览

ios11 - 新 iPhone X 的设计问题

我在模拟器上测试了我的应用程序iPhone X,由于 iOS 系列中添加了新屏幕,在各种屏幕上我面临拉伸背景图像及其显示垂直间距问题,我希望我以前的应用程序在iPhone X. 在所有 iPhone 设备(包括)上完美运行的宽高比应该是iPhone X多少?

任何帮助将不胜感激。

0 投票
1 回答
829 浏览

ios - 使用工具栏时导航栏在 iPhone X 中跳转

当从一个视图转到另一个视图时,它使用导航栏上方的工具栏,然后导航栏会跳转,如图所示。只发生在 iPhone X

在此处输入图像描述

我已经添加了:

但这对这个问题没有帮助。

我没有使用故事板

0 投票
2 回答
1556 浏览

ios - UIPageViewController 页面控件太靠近 iPhone X iOS 11 上的主页栏

我有一个带有一个主视图控制器的程序,其中包括一个按钮,用户可以点击该按钮以通过UIPageViewController. 这 4 个页面是 QuickHelpViewController0ID - QuickHelpViewController3ID,每个页面都是标准的UIViewController. 当他们点击按钮时,我运行这个:

当用户滚动到下一页/上一页时,我还提供了一个UIPageViewControllerDataSource根据需要创建 4 个页面中的每一个。

这在 iOS 9.3 和 10.x 上运行良好。它也适用于除 iPhone X(模拟器)以外的所有设备的 11.0。在这方面,4 个页面指示点行位于屏幕底部,仅比 iOS 11 提供的新“主页栏”高 1 或 2 个像素(向上滑动以切换应用程序等)。

我发现了来自 Apple 的一个名为Building Apps for iPhone X的视频,其中开发人员讨论了解决类似问题,但在这种情况下,他的解决方案是简单地更改自动布局以将孩子限制UIPageControl在底部“安全区域”而不是传统的底部布局指南。但我没有UIPageControl在另一个视图控制器上使用;我正在使用UIPageViewController,并且我看不到任何方法来控制页面控件沿窗口底部的位置。(是的,我在 Interface Builder 中启用了“使用安全区域布局指南”选项。)

我无法想象 iOS 11UIPageViewController在我的场景中默认大小不正确,我也看不到任何明显的修复方法。有什么建议么?

0 投票
2 回答
1719 浏览

ios11 - 从状态栏崩溃中获取蜂窝信号

下面是我的代码,我正在尝试通过状态栏获取信号强度。

崩溃发生在(iOS 11、Xcode 9、iPhone X):-

[UIStatusBar_Modern valueForUndefinedKey:]:这个类对于键foregroundView不兼容键值编码