Jump to content

Search the Community

Showing results for tags 'screen orientation'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 1 result

  1. Hi, I need to rotate the screen at runtime when I open a form. Until the release of IOS 13 this code worked perfectly: procedure ChangeOrientation(toOrientation: UIInterfaceOrientation; possibleOrientations: TScreenOrientations); var win : UIWindow; App : UIApplication; viewController : UIViewController; oucon: UIViewController; begin Application.FormFactor.Orientations := []; //Change supported orientations App := TUIApplication.Wrap(TUIApplication.OCClass.sharedApplication); win := TUIWindow.Wrap(App.windows.objectAtIndex(0)); //The first Windows is always the main Window App.setStatusBarOrientation(toOrientation); {After you have changed your statusbar orientation set the Supported orientation/orientations to whatever you need} Application.FormFactor.Orientations := possibleOrientations; viewController := TUIViewController.Wrap(TUIViewController.alloc.init);//dummy ViewController oucon := TUIViewController.Wrap(TUIViewController.alloc.init); {Now we are creating a new Viewcontroller now when it is created it will have to check what is the supported orientations} oucon := win.rootViewController;//we store all our current content to the new ViewController Win.setRootViewController(viewController); Win.makeKeyAndVisible;// We display the Dummy viewcontroller win.setRootViewController(oucon); win.makeKeyAndVisible; {And now we Display our original Content in a new Viewcontroller with our new Supported orientations} end; However, since the release of IOS 13 the screen locks on the set orientation but does not rotate. So if I set Landscape orientation the screen remains in Portrait orientation until I physically turn the phone around, at which point it rightly remains locked on that orientation. This is a real disaster because then, until the phone is turned, all the controls ( finger position, object position,..) are wrong.
×