ios - 从应用程序调用后顶部的额外空间

标签 ios objective-c

我正在使用 tableView 来显示联系电话和一些相关信息,点击 tableviewCell 可以让我的用户从应用中调用相关人员。

使用以下代码调用电话:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel: 9999999999"]];

问题:

Getting an extra space from top when user ends call and automatically backed the to app, see screenshots below.

通话前:

enter image description here

在系统支持到应用的调用之后:

enter image description here

我该如何解决请提出建议。谢谢。

最佳答案

在您的 View Controller 中,实现 UIBarPositioningDelegate 并在其中添加以下方法。

func positionForBar(bar: UIBarPositioning) -> UIBarPosition {
  return .TopAttached
}

或者,在 ViewWillAppear 上添加这个

var frame: CGRect = (self.navigationController?.view.frame)!
frame.origin.y = 0
self.navigationController?.view.frame = frame

关于ios - 从应用程序调用后顶部的额外空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43040678/

相关文章:

ios - 需要用户凭据才能获取访问 token 。请调用非静默的 acquireTokenWithResource 方法

ios - iOS >>为什么我无法进入UIView.layer.properties?

ios - 在 NativeScript 中执行 XHR-Request 时出现 UICollectionViewFlowLayout 异常

ios - 如何在 Xcode6 的 Storyboard上重置特定大小的类数据?

ios - NSNotificationCenter 并在 View Controller 和我的类之间传递数据/我走错了路吗?

objective-c - NSDistantObject 类上的 NSStringFromClass 和 isKindofClass

objective-c - block 作为 C 函数的参数或返回值

javascript - navigator.geolocation.getCurrentPosition 在 iOS 上失败

iphone - 覆盖 UIScrollview 而不切断 ScrollView 的触摸事件

objective-c - 返回 C 结构数组