Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6129151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:42:32+00:00 2026-05-23T16:42:32+00:00

I am developing an app for iPad2 which allows user to take photos. I

  • 0

I am developing an app for iPad2 which allows user to take photos. I am going to use custom overlay for image picker. But this overlay view does not detect the orientation of the device.

I have tried with
didRotateFromInterfaceOrientation and willAnimateRotationToInterfaceOrientation. But non of them are working. This is how I am creating overlay.

@interface CameraOverlayController : UIViewController <UINavigationControllerDelegate, UIImagePickerControllerDelegate>


-(void)setupImagePicker:(UIImagePickerControllerSourceType)sourceType
{
    self.picker.sourceType = sourceType;

    if (sourceType == UIImagePickerControllerSourceTypeCamera)
    {        
        self.picker.showsCameraControls = NO;        

        if ([[self.picker.cameraOverlayView subviews] count] == 0)
        {
            CGRect overlayViewFrame = self.picker.cameraOverlayView.frame;

            if (UIDeviceOrientationIsLandscape(self.interfaceOrientation)) {
                NSLog(@"Initially Landscape and height : %f" , CGRectGetHeight(overlayViewFrame));
            }
            if (UIDeviceOrientationIsPortrait(self.interfaceOrientation)) {
                NSLog(@"Initially Portrait and height : %f", CGRectGetHeight(overlayViewFrame));
            }
            self.view.backgroundColor = [UIColor clearColor];

            CGRect newFrame = CGRectMake(0.0, CGRectGetHeight(overlayViewFrame) - self.view.frame.size.height - 10.0, CGRectGetWidth(overlayViewFrame), self.view.frame.size.height + 10.0);

            self.view.frame = newFrame;
            [self.picker.cameraOverlayView addSubview:self.view];
        }
    }
}

Can anyone please tell me how can I detect the rotation of the device within camera overlay?

Many thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:42:32+00:00Added an answer on May 23, 2026 at 4:42 pm

    I have solove above issue by myself.
    The above function has been recreated like this.

    -(void)setupImagePicker:(UIImagePickerControllerSourceType)sourceType
    {
        self.picker.sourceType = sourceType;
        if (sourceType == UIImagePickerControllerSourceTypeCamera)
        {
            self.picker.showsCameraControls = NO;                
        }
    }
    

    Then I have use navigation controller delegate. Within this function I could capture the device orientation and solved my issues.

    -(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
    

    Thanks for viewing this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are developing an iPad app for which I am trying to use sharekit
I'm developing an iPad app that allows a user to select widgets to appear
I'm developing an iPad 2 app which will overlay panoramic views on top of
I'm considering developing an app for Google App Engine, which should not get too
I'm developing web app that user can save his/her work to server. The data
I have been developing an app in VB.NET which requires a control object (for
Am developing an ipad app in which I want to pop up the MPMoviePlayer
I'm currently developing an iPad app where a user will enter a photo filename
I am developing a iPAD app with a UITabViewController and some custom controllers initialized
I'm developing the app for all the orientations in Ipad....But during the development I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.