- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们的应用被拒绝了,因为该应用没有以倒置的方向旋转。
所以我们有一个标签栏应用程序,将此代码添加到所有标签...
shouldAutorotateToInterfaceOrientation
没有意义,将此代码添加到 Appdelegate 没有帮助,我们做错了什么?
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES;
}
最佳答案
UITabbarcontroller 是 UIViewcontroller 的子类。要解决您的问题,只需为您的 UITabbarcontroller 实现子类化或添加一个类别:
@interface UITabBarController (rotation)
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
@end
@implementation UITabBarController (rotation)
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
@end
如果你想让标签栏只旋转到纵向和上下颠倒,只需使用以下代码即可
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait ||
interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}
关于iphone - shouldAutorotateToInterfaceOrientation 但没有任何反应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7693517/
我正在尝试将高斯模糊添加到场景中。我正在使用此GLSL着色器:。当您提供图像作为tDiffuse纹理时,它对图像起作用,但我正在尝试将其添加为后处理效果。我试图获取摄影机的renderTarget并将
我正在做一款天气应用程序,到目前为止还不错。现在,我想通过单击按钮来呈现一些额外的信息。我有一个5天的预报,然后想显示每一天的信息。我已经成功地过滤了数据,但无法获得要渲染的数据地图。以下是我的一些代
我正在做一款天气应用程序,到目前为止还不错。现在,我想通过单击按钮来呈现一些额外的信息。我有一个5天的预报,然后想显示每一天的信息。我已经成功地过滤了数据,但无法获得要渲染的数据地图。以下是我的一些代
我在全球安装了Create Reaction应用程序。然后我就跑了。NPX创建-反应-应用JSX。它安装了大约1460个包的所有包,但没有设置Public和src文件夹。在我的JSX文件夹中,只有1:
我是一名优秀的程序员,十分优秀!