【问题标题】:my application doesn't respond with orientation of ipad我的应用程序没有响应 ipad 的方向
【发布时间】:2012-05-20 01:19:15
【问题描述】:

当我旋转 ipad 时,我的应用程序没有旋转,我启用了所有方向并将它们添加到 .plist 文件,但仍然没有响应,我没有找到

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations

    return YES;

} 

在我的应用程序上,我现在不应该把它放在哪里 我的申请详情: 主窗口.xib: 它的文件所有者类是 UIApplication in placeholder 在对象中:App Controller 它的类是 App Controller & 绘画窗口它的类是绘画窗口 & 绘画视图它的类是绘画视图

我有 AppController.h 和 .m

 @interface AppController : NSObject <UIApplicationDelegate>

我有 PaintingWindow.h 和 .m

@interface PaintingWindow : UIWindow

我有 PaintingView.h 和 .m

@interface PaintingView : UIView

我应该把这个函数放在哪里?

【问题讨论】:

    标签: objective-c ipad ios5 window orientation


    【解决方案1】:

    那个方法是一个UIViewController方法,所以你需要有一个UIViewController的子类来放它。

    【讨论】:

    • 不,您必须在 UIViewController 或子类中实现该方法。如果这是您要旋转的视图,您应该有一个视图控制器,其视图是 PaintingView。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多