willTransitionToTraitCollection没有被调用,为什么? [英] willTransitionToTraitCollection not get called, why?
本文介绍了willTransitionToTraitCollection没有被调用,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试用UIViewController子类中的 willTransitionToTraitCollection
替换 didRotateFromInterfaceOrientation
- 正如doc所说,但方法是我在旋转设备时没有被调用。为什么?
I am trying to replace didRotateFromInterfaceOrientation
with willTransitionToTraitCollection
- in a UIViewController subclass - as doc says, but method is not get called when I am rotating device. Why?
推荐答案
如果你在iPad上测试它,它有两个方向的垂直和水平类的常规特征集合,因此当方向改变时,它不会调用此方法。
If you're testing this on iPad it has regular trait collections for vertical and horizontal class for both orientations, thus it will not call this method when orientation changed.
这篇关于willTransitionToTraitCollection没有被调用,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文