iOS 13-UIPopoverPresentationController sourceview内容在箭头中可见 [英] iOS 13 - UIPopoverPresentationController sourceview content visible in the arrow

查看:534
本文介绍了iOS 13-UIPopoverPresentationController sourceview内容在箭头中可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在UIPopoverPresentationController中显示某些视图并将其显示为弹出窗口时

When I am displaying some view in UIPopoverPresentationController and presenting it as popover

popoverCon?.modalPresentationStyle = UIModalPresentationStyle.popover

内容已向上移动,并且一部分正在箭头中显示.

the content have moved upward toward and a some part is being display in the arrow.

我在弹出框周围还有边框

Further I had border around the popover

popoverCon?.view.layer.borderColor = .orange
popoverCon?.view.layer.borderWidth = 1.0;
popoverCon?.view.layer.cornerRadius = 10.0;
popoverCon?.view.layer.masksToBounds = false;

它没有朝着箭头所在的部分显示,但是在箭头的顶端显示了一些边界线.

it is not showing toward the part where arrow is but it displays a little of the border line in the tip of the arrow.

在iOS 12之前,它一直可以正常工作,但在iOS 13中,此问题即将到来.

This was working fine until iOS 12 but in iOS 13 this issue is coming.

关于如何解决此问题的任何建议?

Any suggestions on how I can solve this?

推荐答案

tableView内容的顶部被箭头截断了.这是我在情况下(将代码插入到tableViewController Swift文件中)修复的方式:

The top of my tableView content was cut off by the arrow. This is how I fixed it in my case (code inserted in my tableViewController Swift file):

override func viewSafeAreaInsetsDidChange() {
    if #available(iOS 11.0, *) {
        super.viewSafeAreaInsetsDidChange()
        self.tableView.contentInset = UIEdgeInsets(top: self.tableView.safeAreaInsets.top, left: 0, bottom: 0, right: 0)
    }
}

这篇关于iOS 13-UIPopoverPresentationController sourceview内容在箭头中可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆