Thursday, October 6, 2011

Locking screen rotation in FireMonkey iOS...

Warning: This is a total hack, and should NOT be attempted unless you know exactly what you're doing. I don't know any better, so I just went for it. Editing shipping source files is NEVER supported, encouraged, and shouldn't even be blogged about.

OK, warning aside.

Here we go...

Locate FMX_Platform_iOS.pas on your Mac.

Find this:

function TUIViewController.shouldAutorotateToInterfaceOrientation(
AinterfaceOrientation: UIInterfaceOrientation): Boolean;
begin
Result := True; { HINT! }
end;

Change it. Save it. Done!

PS: Change it to what? Sorry. Not saying... ;)

PPS: You may still have to select supported device orientations in Xcode.

1 comment:

  1. thanx tally for the awesome camp u guys are soooooooo awesome iwould just like to thank u guys for taking moreton downs. mr blount u r the best.ps go mantas (we won team of the week)
    réplique rolex submariner occasion [url=http://www.finewristwatchshop.com/fr/rolex-submariner-watches-c134/]réplique rolex submariner occasion[/url]

    ReplyDelete

Note: Only a member of this blog may post a comment.