Forced landscape rotation problem

Hi all,
like many others im having problems implementing forced landscape rotation.
My app allows a user to select/take a photo. If the photo was taken in landscape orientation then I
force the user to view it in landscape orientation.
I have finally come up with a hack that allows me to do this.
The hack involves removing the navigation controller from the window and adding the landscape view
controller directly to the window which allows the landscape view to override the shouldAutorotateToInterfaceOrientation.
In order to allow the landscape view controller to be navigated to by the navigation controller
I push a "placeholder" view controller onto the navigation controllers stack and the moment it
displays, I remove the navigation controller from the window and add the landscape view
directly to the window.
The landscape controller has its own navigation controller in order to maintain consistency with
the rest of the app. When back is pressed I simply remove the Landscape controller from the window
and then re-add the original navigation controller to the window and pop the placeholder view from
it to prevent the landscape view from being loaded again.
This all works but looks horrible!
What happens is this: After the user has selected a landscape photo, the top status bar rotates to
landscape orientation straight away, but unfortunately the menu bar and the rest of the photo album screen stay in portrait orientation.
After a few seconds my landscape view controller loads and displays the picture as it should.
But for these few seconds after selecting a photo the screen looks foul with mismatched status bar orientation.
I have overidden the drawRect method of the view that draws the landscape image and it seems that it is the call to [image drawInRect] that is causing the problem because it takes so long!
If i remove this call, then the screen switches instantly to my landscape view controller with no horrible unprofessional looking lag, but obviously the picture doesnt get drawn which isnt much use
Please see the screenshot that i have attached as it probably explains the problem much better than I can with words!
In the photo you can see that the status bar has prematurely rotated itself to landscape whilst the rest of the screen stays put in portrait.
If anyone could offer a solution to this problem I would be extremely grateful.
Thanks,
chris.
Screenshot

Hi herbertmunch & welcome to discussions...
Perhaps you are handling the view's frame property and not it's bounds... Those two are not the same when you rotate/transform a particular view.
Be sure to also check out the viewWillAppear method...
See http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiP honeOS/BasicViewControllers/BasicViewControllers.html#//apple_ref/doc/uid/TP4000 7457-CH101-SW24 and http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhone OSProgrammingGuide/WindowsandViews/WindowsandViews.html#//apple_ref/doc/uid/TP40 007072-CH8-SW40

Similar Messages

  • Knowledge Sought--Please post something! Landscape/rotation problem

    I have posted before but no one said anything so I do not know if I am alone or what the deal is.
    I have finally found what causes my iPhone 3G to stop rotating pictures, turning the regular calculator into a scientific one, and stopping webpages from being viewed in landscape (turning the phone on the side)---my iPhone is able to do all of those things until I make a call--then it will not do those things. I must turn the phone off and back on in order to be able to go into landscape mode. Before it seemed a random problem--but I have now discovered it is after I make a call.
    Is anyone else having this problem? Does anyone know anything about this issue??? Any help, comments, etc would be greatly appreciated.

    I notice that at times, web pages will not rotate to landscape mode. I haven't been able to determine if there is a pattern, such as after making or a receiving a call. It seems random and is very frustrating.

  • Forcing Landscape orientation for TabBarController and NavigationController

    Hello,
    I'm writing an application that need to force LandscapeRight with a UITabBarController that contains a UINavigationController that contains UIViewController.
    I can force UIViewController to landscape, but when I add the UINavigationController, the emulator starts as Landscape, but returns to Portrait when I call [window addSubView:], and the viewOrientation field from window switch from 0 to Portrait.
    Is there anybody has worked with landscape orientation ? (it's really hard to make a landscape app, indeed).
    David

    The code below almost works. It does force landscape orientation. The problem I am having is that the navigation items in the navigation bar are not centering themselves until the device is physically rotated. Hope it helps.
    Ed
    [window addSubview:[navigationController view]];
    [window makeKeyAndVisible];
    // get height of status bar before setting the status bar to landscape orientation
    CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
    // set the status bar to landscape orientation
    [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
    // rotate
    UIScreen *screen = [UIScreen mainScreen];
    CGRect newBounds = CGRectMake(0, 0, screen.bounds.size.height, screen.bounds.size.width - statusBarFrame.size.height);
    self.navigationController.view.bounds = newBounds;
    self.navigationController.view.center = CGPointMake(newBounds.size.height / 2.0, newBounds.size.width / 2.0);
    self.navigationController.view.transform = CGAffineTransformConcat(self.navigationController.view.transform, CGAffineTransformMakeRotation(degreesToRadian(90)));
    self.navigationController.view.center = window.center;
    here is the function definition
    #define degreesToRadian(x) (M_PI * x / 180.0)

  • Force Landscape Orientation?

    Does anybody know of a way to force landscape orientation for a view controller in an iPhone application?
    I have defined a UI in Interface Builder that I want to always show in landscape mode.
    When the app first starts though, it is always in Portrait Mode.
    Once the orientation is changed to landscape it will never go back to Portrait since I have setup the shouldAutorotateToInterfaceOrientation method correctly, but I can't seem to figure out a way to start it out in landscape mode.

    Andrew, I'm having a very similar problem. Have you found a solution yet?
    I have an app that has two screens, one is displayed landscape, and the other is displayed portrait. The user can press a button to swap between them. When I switch between the views I call
    [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait];
    or
    [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
    to put the device into the correct orientation for whichever view I'm about to display.
    Problem is, if the user is on the landscape screen, rotates the phone to portrait, and then presses the button to switch to the screen that is in portrait, the new view gets put on in the wrong orientation (landscape). If the user then rotates the device to landscape and back to portrait, it fixes itself. It's like the phone ignored the call to [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait]; if the device is already being held in portrait orientation.
    I've been at this for a few days now, and I'm really stuck. Any help would be appreciated.

  • Epub  force landscape

    I have a small book, 14 images, that I want to force landscape, and always be seen in a landscape one image orientation. I would like this be used with Apple's iPhone/iPad.
    Is there a way to do this indesign?
    I can create the landscape images, I can create the epub document, but when I look at it in a landscape orientation on my iphone, I see two pages, I only want to see one at a time.
    Suggestions?

    Andrew, I'm having a very similar problem. Have you found a solution yet?
    I have an app that has two screens, one is displayed landscape, and the other is displayed portrait. The user can press a button to swap between them. When I switch between the views I call
    [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait];
    or
    [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
    to put the device into the correct orientation for whichever view I'm about to display.
    Problem is, if the user is on the landscape screen, rotates the phone to portrait, and then presses the button to switch to the screen that is in portrait, the new view gets put on in the wrong orientation (landscape). If the user then rotates the device to landscape and back to portrait, it fixes itself. It's like the phone ignored the call to [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait]; if the device is already being held in portrait orientation.
    I've been at this for a few days now, and I'm really stuck. Any help would be appreciated.

  • Rotation problem after editing in Photoshop

    I'm using Lightroom 1.3 and Photoshop CS3 with all the current updates. This problem was the same in LR1 and PS CS2.
    I have a mix of orientations in the JPEGs in my library - portrait and landscape. When the photos are imported into LR they appear correct. If I select a bunch of them, open them in PS (using Edit in Photoshop > Edit Originals), run a noise filter, save them, and then go back to LR, the previews for the portrait images are rotated so that all the previews show as landscape.
    The portrait images display correctly (except for the fact that they have been rotated) in the Library module - both grid and loupe view). In the Develop module, the image aspect is displayed portrait but the image is as a distorted landscape - the image is rotated and then distorted to fill the portrait oriented space. In the Print module, that same distorted image is fills the portrait oriented page. To be clear, instead of a portrait image appearing in the correct orientation on a portrait page preview, the image is rotated 90 degrees and then stretched to fill the page.
    There is a badge on the preview indicating that the metadata is out of sync with the file.
    If I rotate the image in LR, the badge goes away and the image appears portrait and undistorted in the Library module's grid and loupe views. The Develop module show the portrait image in the correct rotation, but has been stretched to a landscape aspect. The Print module shows that distorted image rotated to fit the portrait page.
    The only way to correct this is to "Read Metadata from file". This resets all the orientation information so that it displays correctly in LR, but all the tags and IPTC information gets erased.
    This is most of the reason why I was writing all the metadata into to files until now. I would write the metadata before editing in PS, do my PS edits, and then back in LR I'd "Read the Metadata" from the files to set everything correctly in LR. But of course now that I'm working with Leopard I get screwed if I do this because my files will crash the Finder.
    To top it all off, I've run into the "...cannot be saved because the file is in use" problem with some files I opened last night.
    Clearly none of these issues are being addressed in Adobe or Apple's updates. Is there a reasonable workaround that will let me:
    1. set metadata and tags and know that they won't either get lost or cause problems
    2. have image orientation respected and displayed correctly
    3. not crash any of the three critical applications on this computer - Lightroom, Photoshop, and Finder.

    I really appreciate your explaining this Jao.
    I'm going to explain how I got into this situation, in the hopes that it may prove useful to someone (I'm looking at you, Adobe) who wants to understand how the app is being used in the real world.
    So as not to break up the narrative, let me just say that I'd be happy (ecstatic, actually) if I could use Lightroom for my entire workflow, but the noise reduction filter in LR is just nowhere near as good as NoiseNinja. (A problem shared by LR, PS, and Aperture.) If I could run NN from inside LR, that would rock.
    Oh, and I shoot JPEG because I shoot live events where the lighting is usually crap and I need to be ready at any moment for something interesting to happen. Shooting RAW would be nice, but it's too slow and takes up way too much space.
    So here's what I do, (hopefully edited to make the reading non-tedious)
    1. import all photos from source (usually memory cards)
    The photos go onto a drive reserved for photos. I shoot events, so everything is organised by date-event. On import I set filenames (date - event name - time stamp.jpg) and keywords.
    2. cull
    They get marked "1" (irretrievably useless, to be deleted), "2" (keep just in case), "3" (decent shots), "4" (photos that I want to show to other people), or "5" (this is one of my best this year). Delete the "1"s.
    3. select 20-30 "picks"
    I create a folder within the event folder called "Picks" for these photos. Then I duplicate that folder as "Originals"
    In doing it this way I can protect myself if I need/want to change my cataloguing application. I'm on my fourth one at this point (Lightroom) and while I am generally finding that LR is meeting my needs more than anything else I've tried, I've been burned in the past (how many of us have regretted letting Aperture put all our photos into an incomprehensible database/folder hell?)
    The Picks/Originals structure makes sure that the originals never get touched (because it doesn't show up in LR) and I can quickly find the Picks.
    I -was- writing the metadata to the files so the ratings, keywords, and IPTC info was where it should be - attached to the photo. I've stopped doing this for the time being until this whole Finder-craching debacle is corrected.
    So why am I not using LR's built "Edit - Copy"/stacking function, which more or less duplicates my process?
    Well part of it was my own dumbness - Aperture made the edited copy/variation a Photoshop file, which ballooned my collections with staggering speed. I'm not sure if LR used to do the same thing, or I just made the assumption. My mistake.
    The other part of the problem is just the simplicity of having an Originals folder that is effectively ignored. Using LR will mix the "-edited" files in with originals, which is not as efficient or elegant a solution, but I'll give it a whirl.
    Thanks for your suggestion. If giving up my Picks/Original process solves the rotation problem then perhaps it's a fair trade.
    Still, it seems that the right hand is somehow oblivious to what the left hand is doing in the whole PS/LR thing, and that it ought not work that way.

  • IPad Rotation Problem

    After just 1 week bought the iPad.. i'm facing the rotation problem.. the Apple technicians said its hdware problem and send back to Apple Service Centre... Feel very very sad with this situation... wasting my time and probably my money...

    1. Check the little black rotation lock on the edge of iPad.
    2. Try a reset. Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo.
    http://i1224.photobucket.com/albums/ee374/Diavonex/9ecbcd49.jpg

  • Not all apps rotate with tablet. Is possible force the rotation for a confonable reading?

    I have a Sony Tablet S. Is the best tablet ever. I choose this for the anatomic form of the case. Is very confortable read book, twitter, etc.
    But, some apps don't change the orientation of tablet and I must turn the table and is not confortable. 
    Is possible force the rotation. For example with Moon + Reader (for read ebooks) (free) change the orientation.
    Thanks

    Hello Make,
    You may contact the specific application manufacturer to check if they support rotation.

  • Iphone 6 rotating problem

    My ipone6 has rotating problems with for example the calendar app, somtimes it's working but most of time I can't rotate the screen.
    When is this going to be solved, as I many people are complaining about this?

    Try to reset the phone by holding the sleep and home button for about 10sec, until the Apple logo comes back again. You will not lose any data by resetting, but it can cure some glitches.
    If this does not help, setting it up as new device would be the next step:
    How to erase your iOS device and then set it up as a new device or restore it from backups
    Or, if you want to use your computer and iTunes instead:
    Use iTunes to restore your iOS device to factory settings - Apple Support
    If setting it up as new device does not bring back the full functionality of your brightness settings, get the phone checked by visiting an Authorized Apple Service Provider, Apple Store or contact Apple Support to have it serviced:
    iPhone - Contact Support - Apple Support

  • New log rotation problem

    I have resolved some log rotation problem...I have set del log rtation by size...and now the first time the log rotate,but then the output continue to go on the lod with the extension .log001 and not on the configured file.
    why?

    no,it the server rotates the log only the first time but then it continues to write on the .log001.On the original file it continues to write some server exception.
    the server launch line in the scritp is the follow
    nohup "$JAVA_HOME/bin/java" ${JAVA_VM} ${JAVA_OPTIONS_NODE} ${JAVA_OPTIONS} \
    Dweblogic.Name=${SERVER_NAME} \
    Dweblogic.ProductionModeEnabled=${PRODUCTION_MODE} \
    Djava.security.policy="${WL_HOME}/server/lib/weblogic.policy" \
    Dweblogic.Stdout=/u02/bea/weblogic81/mydomain/mydomain_LOG/myserver_Admin.log \
    Dweblogic.Stderr=/u02/bea/weblogic81/mydomain/mydomain_LOG/myserver_Admin.log \
    weblogic.Server > /dev/null &
    and the config.xml part for the server configuration is the follow
    <Server COMEnabled="true" CompleteMessageTimeout="0"
    ConsoleInputEnabled="false" EnabledForDomainLog="true"
    ExpectedToRun="false" JDBCLogFileName="./mydomain_LOG/jdbc.log"
    JDBCLoggingEnabled="true" JavaCompiler="javac"
    ListenAddress="10.2.1.16" ListenPort="10001"
    MaxMessageSize="100000000" Name="myserver_Admin"
    ServerVersion="8.1.3.0" SocketReaderTimeoutMaxMillis="10"
    StagingMode="nostage" StdoutDebugEnabled="true"
    StdoutEnabled="true" StdoutSeverityLevel="16" TransactionLogFilePrefix="../myserver_LOG/myserverAdminTransaction.log">
    <SSL Enabled="false" IdentityAndTrustLocations="KeyStores"
    ListenPort="10002" Name="myserver_Admin"/>
    <Log FileCount="4" FileMinSize="30"
    FileName="/u02/bea/weblogic81/mydomain/mydomain_LOG/myserver_Admin.log"
    FileTimeSpan="1" Name="myserver_Admin"
    NumberOfFilesLimited="true" RotationType="bySize"/>
    <WebServer LogFileCount="2" LogFileLimitEnabled="true"
    LogFileName="./mydomain_LOG/access.log"
    LogRotationPeriodMins="360" LogRotationType="size"
    MaxLogFileSizeKBytes="20000" Name="myserver_Admin"/>

  • Recent netflix upgrade forces landscape mode. now unable to watch on a docking station

    it doesnt make sense for netflix to force landscape mode to view movies. The ipad is designed to be able to be viewed in both landscape and portrait and there is a plug at the bottom of the ipad to charge and allow it to dock in an upright position. PLease how can we tell netflix to change it back?> Netflix support tells me it is Apple who changed it but i cant talk to Apple unless i pay money .
    any APP developers listening?

    I'd love to see your copy of your conversation with Netflix, schwartz43o.
    I have been trying to talk to Netflix CS via Twitter about this issue since the April update. Every time I mention it, at first, they are all confused and ask me if I'm getting an error message. Then they come back and say, "Oh, yeah. We removed that feature. Thanks for the feedback; we'll pass it on." The absolute worst response was when I mentioned the Kindle Fire allows portrait viewing. "Some tablets have different capabilities, but we are constantly striving for a uniform experience." Um, hello. We HAD a uniform experience until you took it away.
    I don't understand what the "post play" feature has to do with screen orientation. Granted, I'm not a programmer, developer or any kind of computer whiz. But I would like to think that those two areas would be separate from each other.
    I'd honestly trade the two seconds it takes me to hit play on the next episode, for the ability to utilize my iPad's portrait orientation the way I want to.

  • Rotation Problem on FCP

    Friends,
    When I rotate a video on FCP (does not matter the degrees, 20, 45, 90...), using the motion tab, my rendered images gets sort kind of distortion... When I preview it on FCP, it rotates ok, but when I export using the Compressor, when the video rotates, it squeezes, it does not look right...
    Please, could someone help me?
    Thanks

    Yes - the button is in rotation lock mode (not mute).
    Neither switch setting (up or down) work. The state of the button is accurately reflected on the screen when changed, but the problem of not rotating problem when unlocked persists.
    Given that this started just after updating to iOS 7.0.6 I'm inclined to think there is a software issue.

  • My ipad has suddenly began to have rotation problems, sometimes it will rotate but always opens in landscape mode, sometimes it refuses to rotate?

    My ipad has started having difficulty rotating.  It always opens in landscape mode, no matter which way the book is turned and sometimes if you open an app it will rotate but other times you can't make it rotate.

    Try reset all settings
    Settings>General>Reset>Reset All Settings
    Note: Data will not be affected but settings will be reset.

  • [iPhone] auto-rotation problems

    I'm having a really tough time getting auto-rotation to work properly.
    My biggest problem is most of my application only works in Portrait mode, but there is one view (with subviews) and a controller that handles landscape (it displays an image). When I rotate the device to landscape mode while this view is up, then cause this controller to pop back to the previous controller (a navigation controller), the rest of the interface is now in landscape mode instead of portrait, which is messing up my other portrait only views. I expected that popping my landscape-supporting controller would revert the interface to portrait, since none of the other controllers support landscape.
    Anyone know what I'm doing wrong?
    And is there a way to "force" the device into landscape mode when a landscape image is selected? See I have a image picker controller (portrait), and when I pick a landscape image I'd ideally like to just have my image viewer (and subviews) show up in landscape mode - like how Movie Player does it.
    I know this is possible, but I haven't figured out how yet.

    I am having the same problem that you have descibed below. Did you ever find a solution? I have tried all types of possible solutions but cannot get the previous view to revert back to portrait as well.

  • Auto Rotate problems when shooting tethered overhead

    I am shooting with a Canon 5d mark 2.  When I shoot product into the auto rotate works properly and the image appears rotated properly. Although when I shoot overhead or down on product it seems to get confused. If I rotate the camera twords the horizon and fire it figures out which way it should be the I can reframe my overhead shot.  But if the camera is moved at all it will show up rotated the wrong way and I have to slightly move the camera away from its directly overhead framing again so it can figure out wich way it should be rotating. I have tried all three rotate modes with the camera with similar inconsitant results. What is the best setting on the camera to get consistant results. Or ii I turn auto rotate off is there a way to tell lightrroom to rotate it properly on import like it does for all other settings like white balance.

    This isn't a function of tethering, I wouldn't think. Many cameras have a sensor that determines the orientation of images so auto-rotate works. The problem is that these sensors generally only work along one axis, using the force of gravity to tell them where down is. When you orient the camera such that the lens is pointing down most sensors no longer are able to determine whether you are in portrait or landscape, because there is no down -- it ends up being somewhat random.
    I've seen this on many different cameras, and all without tethering. It has to do when the sensor is read when composing the short.
    Your best bet is to set the camera to ignore the sensor when taking pics like this, and rotate the image by hand that are need to be in portrait. If there is no rotation in the image metadata, Lr will not rotate it. It will have to be done by hand. It won't be that hard to select a number of images and bulk rotate them.

Maybe you are looking for

  • How to include Drop index in PL/SQL

    Hi, In my PL/SQL, I put a drop index statement in between, but it gave me an error of "PLS-00103: Encountered the symbol "DROP" when expecting one of the following: begin declare exit for goto if loop mod null pragma raise return select update while

  • Print out array to JTextArea

    Hello! I having trouble to print out the array to a JTextArea. This is an asignment so please do not spoonfeed me with code. To test that I have added elements correctly in my array I sat it up to print out in console, wich works fine. Please give me

  • HT201320 Can't reset email password in settings, keeps reverting to old password

    Changed yahoo mail password due to being spoofed I think.  When I change it in IPad settings, it will verify ok but when go back to the settings it is the old password in mail settings.

  • Copy Delivery Address from SO to PR

    In our third party shipment process for legal reasons we have to "receive" the material in our plant althought the material should be ship directly to customer from supplier, so we set up an individual purchase process. But one thing its missing its

  • Difference between General Ledger Accounting (New) and Old

    Hello All, Please help me with the below: 1)Could any one please explain the difference between General Ledger Accounting (New) and General Ledger Accounting (Old). After going through the help document I understood that the BI 7 version came up with