Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

横竖屏问题 #8

Closed
Zorodon opened this issue Dec 7, 2017 · 16 comments
Closed

横竖屏问题 #8

Zorodon opened this issue Dec 7, 2017 · 16 comments

Comments

@Zorodon
Copy link

Zorodon commented Dec 7, 2017

可否暴露一个支持横竖屏的方法,出现弹窗后页面状态栏就会滑动,但是需求不能滑

sharedWindow.m里面
[EBBannerViewController setSupportedInterfaceOrientations:UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscape];
默认横竖屏都支持

@pikacode
Copy link
Owner

pikacode commented Dec 8, 2017

@Z-DDong 当时考虑到了这个问题,其实在 EBBannerViewController.h 里面已经提供了,但是没有放进 public,我改一下

@pikacode
Copy link
Owner

pikacode commented Dec 8, 2017

@Z-DDong 已经在 1.0.5 版本更新了,你 pod repo update 一下,再 pod install 应该就可以了

@Zorodon
Copy link
Author

Zorodon commented Dec 8, 2017

@pikacode 我更新了,但是我应该在哪里设置只显示竖屏的呢。。sharedWindow还是两个方向都支持。

@pikacode
Copy link
Owner

pikacode commented Dec 8, 2017

@Z-DDong 你看下 EBBannerViewController.h

@pikacode
Copy link
Owner

pikacode commented Dec 8, 2017

@Z-DDong

#import <EBBannerViewController.h>
[EBBannerViewController setSupportedInterfaceOrientations:(UIInterfaceOrientationMaskPortrait)];

@Zorodon
Copy link
Author

Zorodon commented Dec 8, 2017

@pikacode 这种方式有点奇怪。。。这段代码要放在show之后

@Zorodon
Copy link
Author

Zorodon commented Dec 8, 2017

@pikacode 可以了,非常感谢,之前暴力的直接把sharedWindow的方向直接改成竖屏,哈哈

@pikacode
Copy link
Owner

pikacode commented Dec 8, 2017

@Z-DDong 因为有的 app 可能在某些页面支持全屏,某些页面只支持竖屏,可以用这个方法适配不通的情况

@pikacode
Copy link
Owner

pikacode commented Dec 8, 2017

@Z-DDong 这段代码应该不用特定放在 show 之后

@Zorodon
Copy link
Author

Zorodon commented Dec 13, 2017

@pikacode 大大,还有坑!!我设置竖屏后,show弹窗,接着present到一个横屏的界面,弹出来的键盘是竖的,感觉和你那个window有关

@pikacode
Copy link
Owner

@Z-DDong 你可以确认一下你是用哪个 controller present 的,不要使用 EBBannerViewController,或者确认一下 keywindow 是哪个,或者在 present 到横屏截面之前,用上面提到的方法把 EBBannerViewController 也设置成横屏

@pikacode pikacode reopened this Dec 13, 2017
@Zorodon
Copy link
Author

Zorodon commented Dec 13, 2017

@pikacode controller是我的,keywindow也不是EBBannerWindow,如果present前设置横屏,dismiss又要设置竖屏。。侵入性太强了

@pikacode
Copy link
Owner

@Z-DDong 只需要在 banner 的 show 之前设置竖屏,present 之前设置横屏。另外你的问题不用这个库也会出现吗,你是否确认是因为用了这个 banner 引起的?如果是的,我会在有空的时候写个 demo 测试一下你说的问题。

@Zorodon
Copy link
Author

Zorodon commented Dec 13, 2017

是的,用了这个库才有问题的。我直接在你demo上改的,SystemStyleViewController固定竖屏,show banner,self present一个横屏的,加个textField看下键盘,有空帮我看看哈~谢谢

@pikacode pikacode added the bug! label Dec 13, 2017
@pikacode
Copy link
Owner

@Z-DDong 你好,最新版本修复了你的问题 1.0.6

@xieguangming
Copy link

大神6666. 膜拜一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants