iOS 10 iMessage应用程序扩展:如何计算超高导航栏的高度 [英] iOS 10 iMessage app extension: how do i calculate the height of the extra tall navbar

查看:121
本文介绍了iOS 10 iMessage应用程序扩展:如何计算超高导航栏的高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了Xcode 8 Beta,并尝试使用iMessages应用扩展程序sdk,但遇到了看似不标准的导航栏高度

I downloaded the Xcode 8 beta and was trying to play around with the iMessages app extension sdk but ran into an issue with their seemingly nonstandard nav bar height

当我过渡到应用的展开视图时,带有以下框CGRect(x: 0, y: 0, width: 100, height: 100)的图像最终部分隐藏在导航栏的后面.我希望它显示在导航栏下方.

when i transition into the app's expanded view, my image with the following frame CGRect(x: 0, y: 0, width: 100, height: 100) ends up partially hidden behind the nav bar. i would like it to appear below the nav bar.

我尝试了self.navigationController?.navigationBar.isTranslucent = false,但没有成功,我认为这是有道理的,因为它超出了我应用程序的控制范围.

i tried self.navigationController?.navigationBar.isTranslucent = false but it didn't work, which i guess makes sense since it's out of my app's scope to control.

有人玩过这个吗?我想避免两件事.只需猜测合适的高度并远离程序化解决方案即可. 谢谢你的帮助

has anyone played around with this yet? i want to avoid 2 things. simply guessing the appropriate height and moving away from a programmatic solution. thanks for the help

推荐答案

使用顶部布局指南进行约束可能会有所帮助,如下所示:

It may help to have a constraint with the top layout guide like so:

view.topAnchor.constraint(equalTo: self.topLayoutGuide.bottomAnchor).isActive = true

这篇关于iOS 10 iMessage应用程序扩展:如何计算超高导航栏的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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