Giter Club home page Giter Club logo

Comments (6)

stefanoa avatar stefanoa commented on July 17, 2024

Hi mradlmaier,

sorry for the late replay. I am not sure I understood correctly. If you need to rotate the interface depending on the currently selected content view controller maybe the solution suggested in http://stackoverflow.com/questions/20355089/shouldautorotate-supportedinterfaceorientations-and-preferredinterfaceorientati will work.
In the SASlideMenu case you will need to subclass SASlideMenuRootViewController and do something like:

- (BOOL)shouldAutorotate {
    UIViewController* topController =  [self.selectedContent  topViewController];
    return [topController shouldAutorotate];
}

- (NSUInteger)supportedInterfaceOrientations {
    UIViewController* topController =  [self.selectedContent  topViewController];

    return [topController supportedInterfaceOrientations];
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    UIViewController* topController =  [self.selectedContent  topViewController];
    return [topController preferredInterfaceOrientationForPresentation];
}

But I do not have the time to test it now.

from saslidemenu.

mradlmaier avatar mradlmaier commented on July 17, 2024

I want that some view controllers are in Landscape/Portrait and others only in Portrait.

The stackoverflow.com post doesn't work. I tried a few other similiar solutions and they don't work in a SASlideMenu Project, but work in normal projects. I believe it has to do with SASlideMenu.

from saslidemenu.

stefanoa avatar stefanoa commented on July 17, 2024

Thinking a little more about it, my conclusion is that it is not possible to have SASlideMenu to support different orientation for different content controller.
If you want a view controller that can be in landscape and another only in portrait what should be the behaviour when you exit from one controller that is in landscape and you switch to the other controller that cannot be in landscape?
The menu will be rotated and so will be the content controller.
Currently SASlideMenu only support one behaviour at time.

from saslidemenu.

mradlmaier avatar mradlmaier commented on July 17, 2024

I understand. The only way would be that the menu supports all orientations, and, when exiting a view controller, the menu rotates to the last view controllers orientation. Maybe users might find it confusing. However, would be nice, if one could see it in action to make up one's mind if it is good or not...

from saslidemenu.

stefanoa avatar stefanoa commented on July 17, 2024

I think it will be confusing. What you can do is when you need a landscape view you present it modally. That way it will be responsibility of the specific view controller to define the orientation behaviour, that view should be presented from a content view controller.

from saslidemenu.

mradlmaier avatar mradlmaier commented on July 17, 2024

I would present it modally, but it is a little more complicated. The view controller, which I want to present in landscape, is contained in a tabbar controller, so I can't present it modally.

from saslidemenu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.