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

  • Home
  • SEARCH
  • 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 6717297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:50:07+00:00 2026-05-26T08:50:07+00:00

I have an iPad app with split view controller. I want to programmaticaly create

  • 0

I have an iPad app with split view controller.

I want to programmaticaly create and add subview to detailViewController in right bottom corner. To do that i try to get frame of detailView (app support autorotation, so that position not static)

i do next

in viewWillAppear for detailView i try to get frame and calculate position i need

- (void)viewWillAppear:(BOOL)animated {

  [super viewWillAppear:animated];    

    CGRect btnRect = self.view.frame;
    //it always return 1024*748 width and height
    //even in landscape mode
    //when as i think must return 1024-321=703*748 pxls
    //where is my mistake? How i can get actual frame
    //dimensions for detailViewController in landscape orientation

    btnRect.origin.y = btnRect.size.height - 42;
    btnRect.origin.x = btnRect.size.width - 42;
    btnRect.size.height = 42;
    btnRect.size.width = 42;

    UIButton* btn = [UIButton buttonWithType:UIButtonTypeCustom];
[btn setBackgroundImage:someimage forState:UIControlStateNormal];
[[btn layer] setFrame:btnRect];

   [self.view addSubview:btn];  
}

But it always show me that detailView frame has 1024*748 dimensions. When in landscape mode i think it must be 703*748. What i need to do to get actual detailView frame?

  • 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-26T08:50:07+00:00Added an answer on May 26, 2026 at 8:50 am

    You should want to change the frame of the view in the shouldAutorotateToInterfaceOrientation method.

    An example:
    (This one will adjust scrollView2 to fit its new orientation (88 pixels lower then the mainview))

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        // Return YES for supported orientations
    
        if (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
    
            // Portrait
            self.scrollView2.frame = CGRectMake(0, 88, [UIScreen mainScreen].bounds.size.width, self.view.frame.size.height - 88);
            [self drawContent];
        }
        else {
    
            // Landscape
            self.scrollView2.frame = CGRectMake(0, 88, [UIScreen mainScreen].bounds.size.height, self.view.frame.size.width);
            [self drawContent];
        }
    
    
        return YES;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a split view controller-based iPad app that uses a Web View to
I have a split view controller in my Ipad app, in which the detail
I have a split View Controller iPad app. Its a port of a iPhone
I have a split view app running fine on the iPad. It is using
I have created split view based ipad app, where master view is table view
I have made a new split view iPad app using CoreData. All I have
I am using a split view controller in an iPad app I am trying
I'm working on an iPad app in a split view controller where the app
I have an iPad split-view app. The detailview is a webview. In which method,
In my current Ipad app, I have a split screen view in which the

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.