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 6355861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:51:04+00:00 2026-05-24T22:51:04+00:00

I’m working on a custom UIPopoverController . I’m not subclassing, I’m writing my own

  • 0

I’m working on a custom UIPopoverController. I’m not subclassing, I’m writing my own from scratch as a NSObject subclass.

It works quite simply. It adds a fullscreen UIView to the UIWindow to intercept touches. Above that view, it adds the (smaller) popover view and it positions the popover at a suitable point.

I’ve tested it in a portraid iPad app and it works fine. It positions the popover view well.

But now I’ve encountered a problem. I need to use it in a landscape iPad app, but the view of my popover controller is still displayed portrait rather than landscape. It doesn’t autorotate (which, I thought, it should).

I know I can manually rotate the view by setting the transform property. But this will make things really complex, because I will have to recalculate the correct positioning, taking the 90 degree rotation in account. Is there any way around this?

  • 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-24T22:51:05+00:00Added an answer on May 24, 2026 at 10:51 pm

    Let’s have a look at what the UIPopoverController is doing here. From the documentation:

    If the user rotates the device while a popover is visible, the popover
    controller hides the popover and then shows it again at the end of the
    rotation. The popover controller attempts to position the popover
    appropriately for you but you may have to present it again or hide it
    altogether in some cases.

    So the UIPopoverController isn’t rotating the popover view that it maintains, like a UIViewController would. This makes sense, considering that UIPopoverController inherits from NSObject, and therefore doesn’t inherit the UIViewController‘s code that handles the rotation.

    You’re trying to implement your own UIPopoverController (I won’t ask why!), and you’re also inheriting from NSObject, so you inherit no code that will rotate your views for you. When you add your fullscreen UIView to the UIWindow, the UIView exists within the UIWindow coordinate space. When you rotate the device, the coordinate space of the UIWindow never changes. In order for your view to be rotated and moved to the correct space in landscape mode, you’ll have to do this manually by applying a CGSAffineTransform to the transform property of your UIView, perhaps calculating a rotation matrix using an angle derived from the interface orientation of the status bar (this is the sort of thing that a UIViewController would do for you!)

    Your custom UIPopoverController could manage the rotation, but it would be easier to get this for free using a UIViewController subclass if possible.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I need a function that will clean a strings' special characters. I do NOT
I am writing an app with both english and french support. The app requests

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.