开发者

ipad rotation problem in a view based app using uinavigationcontroller

开发者 https://www.devze.com 2023-03-13 09:59 出处:网络
I am creating an app for ipad for the first time. i have created a view based app and in appdelegate i have added uinavigationcontroller.

I am creating an app for ipad for the first time. i have created a view based app and in appdelegate i have added uinavigationcontroller. in myappviewController (myapp is proj开发者_StackOverflow社区ect name) screen is rotating. Then i have created a new file(right click class folder->Add->new file->ios cocoa touch class->UIViewController subclass. now i am pushing this view using

    [self.navigationcontroller pushviewcontroller:secondview animated:YES];

now this view is not rotating. shouldAutoRotateToInterfaceOrientation is returning YES in both files. please help me.


Try:

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消