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

The Archive Base Latest Questions

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

how do I ensure a custom UIView I have is repositioned properly after an

  • 0

how do I ensure a custom UIView I have is repositioned properly after an orientation change of the iPhone?

Background

  • As a parent view I have a UIViewController with an XIB
  • I have a custom UIView which is used in this parent (inserted in the XIB via Interface Builder). It programmatically at init creates some UIImageView’s and adds them via “self addSubview”, and then positions them via “self addSubview:imageView1” type approach

So the questions are how do I ensure I get the correct layout of these as orientation changes. Specifically:

  1. Where do I trigger any such redrawing of the custom UIView? (e.g. is there a method in the parent UIViewController I should be using to trigger from?)

  2. When the trigger occurs how do I request the redraw of the custom UIView? Do I need a custom method I create myself like “relayoutCustomView”? or should I be able to use an existing method in the custom UIView, in which case do I need to make sure in the custom UIView that my layout code is in a particular method?

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-23T17:10:33+00:00Added an answer on May 23, 2026 at 5:10 pm

    how’s this for the answer – seems to be starting to work, not sure if it’s the best way:

    1. separate out the layout code in my custom view and put in a separate method and make this public
    2. this method will be called from within the custom view “init” method upon setup
    3. also now however create an “didRotateFromInterfaceOrientation” method in the parent, and from within here also call into the new custom view layout method mentioned in [1]
    4. noted it had to be “didRotateFromInterfaceOrientation”, as with the “didRotateFromInterfaceOrientation” method it didn’t work as the self.bounds result hadn’t yet changed

    How does this sound? I didn’t use the “setNeedsDisplay” anywhere…

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

Sidebar

Related Questions

Background - in my iPhone app I have a custom UITableViewController - I was
I have defined a custom target in cmake. I now want to ensure that
Currently I have a custom view: public class MyView extends View { public MyView(Context
I've written a custom view which I'd like to ensure is viewable on any
I've created a custom container view controller using the new UIViewController container view controller
In one of my apps, I have a custom drawn semitransparent UIView that I
I want to ensure that a WCF-ServiceClient State will be closed after using the
I cannot ensure whether the background-image style is valid for <tr> because the image
I'm building a custom package of vnc and would like to ensure the xdcmp
I have a custom ApplicationContext and I'm trying to terminate it if specific conditions

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.