从iOS 11.2开始,我注意到(BOOL)shouldAutorotate, (BOOL)shouldAutorotateToInterfaceOrientation, (UIInterfaceOrientationMask)supportedInterfaceOrientations不再调用等.
如何防止旋转到某个方向?
我可以在目标的部署水平关闭旋转,但我真正想要关掉旋转只是为iPhone X.我有没有故事板,旧的应用程序,并且不想改变应用程序兑现傻在横向模式下切入屏幕.
风景在我的应用程序中非常有用,因为在iPhone上你可以在横向模式下获得更宽的键盘,这很不错.否则我将删除所有iPhone型号的旋转..
它在以下文档中UIViewController:
"从iOS 8开始,所有与旋转相关的方法都被弃用.相反,旋转被视为视图控制器视图大小的变化,因此使用...进行报告."
和:
"你可以覆盖preferredInterfaceOrientationForPresentation .."
但这也没有被称为.不在根视图控制器中,也不在其他视图控制器中.
那么,如何以编程方式阻止现在轮换到某个方向呢?
我正在尝试在构建过程中向ssh-agent(docker映像)添加本地私钥。
问题
我已经运行, eval$(ssh-agent -s)并且一旦docker运行,ssh-add /etc/ssh/id_rsa我会收到以下错误:
Could not open a connection to your authentication agent.
目标:我需要在NPM安装过程中克隆一个私有git repo。此本地密钥将允许我针对私人存储库进行身份验证。
====输出片段====
Step 8/16 : RUN eval $(ssh-agent -s)
---> Running in 195ffeb1f84f
Agent pid 8
---> 0fcbc89d362f
Removing intermediate container 195ffeb1f84f
Step 9/16 : RUN ssh-add /etc/ssh/id_rsa
---> Running in ae99039e1fba
Could not open a connection to your authentication agent.
The command '/bin/sh -c ssh-add /etc/ssh/id_rsa' returned a non-zero code: 2
Run Code Online (Sandbox Code Playgroud)